GitHub - Eren121/CppColorGradient: Single header gradient library designed for linear colors gradients but generic. · GitHub
Skip to content

Latest commit

 

History

14 Commits

Folders and files

Repository files navigation

CppColorGradient

Single header gradient file library designed for linear colors gradients but generic.

Color

gradient::Color is a std::valarray typedef. Though the module can work with any valarray size, typically 3-component for RGB and 4 for RGBA, when using gradients with that, take care of that every element has the same size.

Concrete example

#include <stdlib.h>
#include <iostream>
#include "Gradient.h"

int main(int argc, char* argv[]) {
    using std::cout;
    using std::endl;
    using namespace gradient::operators;

    gradient::LinearColorGradient gradient;
    gradient[0.0] = {1,2,3};
    gradient[1.0] = {2,3,4};

    cout << gradient(1.01) << endl;

    return EXIT_SUCCESS;
}

About

Single header gradient library designed for linear colors gradients but generic.

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages