122 const std::array<double, 2>& s_or_c_lim,
123 const std::array<double, 2>& l_lim,
185 std::vector<colors::RGB>
extend(
const std::vector<colors::RGB>& palette,
189 std::vector<colors::RGB> selectColors(
191 const std::vector<colors::RGB>& fixed_palette = {});
193 std::vector<colors::RGB> rgb_colors_in;
195 std::vector<std::string> hex_colors;
199 std::array<double, 2> h_lim = { 0, 360 };
200 std::array<double, 2> s_or_c_lim = { 0, 1 };
201 std::array<double, 2> l_lim = { 0, 1 };
202 std::size_t n_points = 1000;
216 std::map<std::string, double> cvd;
217 std::optional<colors::RGB> bg;
219 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 & setColorspaceSize(std::size_t n_points)
Set the number of points in the colorspace grid for HSL and LCHab 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.
Qualpal & setInputColorspace(const std::array< double, 2 > &h_lim, const std::array< double, 2 > &s_or_c_lim, const std::array< double, 2 > &l_lim, ColorspaceType space=ColorspaceType::HSL)
Set input colors by sampling a colorspace (HSL or LCHab).
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 and analysis.
@ CIEDE2000
CIEDE2000 (Delta E 2000) color difference.
Qualitative color palette generation library.
ColorspaceType
Supported cylindrical color spaces for input colors.