102 const std::array<double, 2>& s_lim,
103 const std::array<double, 2>& l_lim,
160 std::vector<colors::RGB>
extend(
const std::vector<colors::RGB>& palette,
164 std::vector<colors::RGB> selectColors(
166 const std::vector<colors::RGB>& fixed_palette = {});
168 std::vector<colors::RGB> rgb_colors_in;
170 std::vector<std::string> hex_colors;
174 std::array<double, 2> h_lim = { 0, 360 };
175 std::array<double, 2> s_or_c_lim = { 0, 1 };
176 std::array<double, 2> l_lim = { 0, 1 };
177 std::size_t n_points = 100;
191 std::map<std::string, double> cvd;
192 std::optional<colors::RGB> bg;
194 double max_memory = 1;
Builder for qualitative color palette generation.
Qualpal & setInputRGB(const std::vector< colors::RGB > &colors)
Set input colors from a vector of RGB values.
Qualpal & setInputColorspace(const std::array< double, 2 > &h_lim, const std::array< double, 2 > &s_lim, const std::array< double, 2 > &l_lim, ColorspaceType space=ColorspaceType::HSL)
Set input colors by sampling HSL colorspace.
Qualpal & setColorspaceSize(std::size_t n_points)
Set the number of points in the colorspace grid for HSL input.
Qualpal & setMetric(metrics::MetricType metric)
Set the color difference metric to use.
Qualpal & setInputPalette(const std::string &palette_name)
Set input colors from a named palette.
std::vector< colors::RGB > generate(std::size_t n)
Generate a qualitative color palette with the configured options.
Qualpal & setMemoryLimit(double gb)
Set the maximum memory limit (in GB) for color difference matrix.
std::vector< colors::RGB > extend(const std::vector< colors::RGB > &palette, std::size_t n)
Extend an existing palette by adding n new colors.
Qualpal & setBackground(const colors::RGB &bg_color)
Set the background color for palette generation.
Qualpal()=default
Default constructor. Initializes with no input source.
Qualpal & setInputHex(const std::vector< std::string > &colors)
Set input colors from a vector of hex color strings.
Qualpal & setCvd(const std::map< std::string, double > &cvd_params)
Set color vision deficiency simulation parameters.
RGB color representation with values in [0,1] range.
Color representation classes.
Color difference metrics for qualpal.
MetricType
Supported color difference metrics for palette generation.
@ DIN99d
DIN99d color difference.
Qualitative color palette generation library.
ColorspaceType
Supported cylindrical color spaces for input colors.