Skip to content

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

License

Notifications You must be signed in to change notification settings

Eren121/CppColorGradient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

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

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages