color_map.hpp

Tools to dynamically build (and cache) color maps.

Functions

std::string ColorHSL(double h, double s, double l)

Generate a string to describe a JS color out of HSL values.

std::string ColorRGB(int r, int g, int b)

Generate a string to describe a JS color out of RGB values.

std::string ColorRGB(int r, int g, int b, double a)

Generate a string to describe a JS color with an alpha channel.

std::string ColorHSV(double h, double s, double v)

Generate a string to describe a JS color out of HSV values.

const vector<std::string> &GetHueMap(size_t map_size, double min_h = 0.0, double max_h = 360.0, int s = 100, int l = 50)

Generate a vector of color strings with a specified range of hues, and fixed satuation and luminosity,

vector<std::string> GetHSLMap(size_t map_size, double min_h = 0.0, double max_h = 360.0, int min_s = 100, int max_s = 100, int min_l = 50, int max_l = 50)

Generate a vector of color strings providing ranges of all of hue, satuation and luminosity.