19#ifndef MiL_SVG_COLOR_PALETTE_H
20#define MiL_SVG_COLOR_PALETTE_H 1
28template<
typename T, std::
size_t N>
31template<std::
size_t N>
34template<std::
size_t N>
379 static bool initp(
false);
380 if (sortbyhuep && !initp)
383 std::reverse(spectrum.begin(), spectrum.end());
395 const uint maxc = spectrum.size();
396 static std::mt19937_64 rg(std::random_device{}());
397 auto disti = std::uniform_int_distribution<>(startoffset, maxc - 1);
398 uint index = disti(rg);
399 return spectrum[index];
402template<
typename _Spectrm>
406 const uint maxc = spectrm.size();
407 static std::mt19937_64 rg(std::random_device{}());
408 auto disti = std::uniform_int_distribution<>(startoffset, maxc - 1);
409 uint index = disti(rg);
410 return spectrm[index];
420 auto itr = std::find(spectrum.begin(), spectrum.end(), klr);
421 if (itr != spectrum.end())
424 if (itr == spectrum.end())
425 itr = spectrum.begin();
constexpr uint color_max_size
Total number of enumerated colors.
palette< color_qi, N > palette_qi
static const palette_qi< 118 > jp_palette
Japan colors (118) https://en.wikipedia.org/wiki/Traditional_colors_of_Japan.
palette< color_qf, N > palette_qf
static const palette_qi< 73 > ciecam02_palette
color_qi next_color(const color_qi klr)
Loop through color array starting at position c. Iff klr is not found, return color::none as the next...
static const palette_qi< 43 > colorbrewer2s7s_palette
Single hue 7-class sequential, low to high.
auto & active_spectrum(const bool sortbyhuep=false)
Oklab https://bottosson.github.io/posts/oklab/.
static const palette_qi< 55 > colorbrewer2s9s_palette
Single hue 9-class sequential, low to high.
color_qi random_color(const uint startoffset=0)
Random entry from array above.
static const palette_qi< color_max_size - 4 > izzi_palette
Default colors for izzi.
color_qi start_at_color(const color_qi klr)
Start at specified color bar entry point.
bool color_qf_lt(const color_qf &k1, const color_qf &k2)
Forwarding function.
static const palette_qi< color_max_size - 20 > izzi_hue_palette
Only color no black and white or gray.
std::array< T, N > palette
Palette, finite set of colors used. Must end with color::none.
static const palette_qi< 19 > colorbrewer2s3s_palette
ColorBrewer 2.0 https://colorbrewer2.org.
Color quantified as integral RGB components in the range [0,255]. aka like Scalar in OpenCV.