19 constexpr Rgb(
float red,
float green,
float blue)
30 float r;
float g;
float b;
79 constexpr Color(
const Rgb& a_rgb,
float a_alpha = 1.0f)
147 return {
static_cast<float>(r) / 255.0f,
static_cast<float>(g) / 255.0f,
static_cast<float>(b) / 255.0f};
151constexpr Hsl hsl(
int deg,
float s,
float l)
153 return {.
hue =
An::from_degrees(
static_cast<float>(deg)), .saturation = s / 100.0f, .lightness = l / 100.0f};
constexpr eu::Rgb red_vermillion
constexpr eu::Rgb blue_sky
constexpr eu::Rgb green_bluish
constexpr eu::Rgb rgb(int r, int g, int b)
helper function to create a rgb color with code similar to css causing some editors to display a colo...
constexpr Hsl hsl(int deg, float s, float l)
helper function to create a hsl color with code similar to css causing some editors to display a colo...
constexpr eu::Rgb purple_redish
Rgb srgb_from_hsl(const Hsl &hsl)
float srgb_from_linear(float value)
Rgb srgb_from_okhsv(const OkHsv &hsv)
OkLch oklch_from_oklab(const OkLab &c)
OkHsv okhsv_from_srgb(const Rgb &rgb)
Lin_rgb gamut_clip_adaptive_l0_l_cusp(const Lin_rgb &rgb, float alpha=0.05f)
Lin_rgb linear_from_oklab(const OkLab &c)
OkLab oklab_from_linear(const Lin_rgb &c)
Lin_rgb gamut_clip_preserve_chroma(const Lin_rgb &rgb)
OkHsl okhsl_from_srgb(const Rgb &rgb)
Lin_rgb keep_within(Lin_rgb c)
Lin_rgb gamut_clip_project_to_0_5(const Lin_rgb &rgb)
Lin_rgb gamut_clip_project_to_l_cusp(const Lin_rgb &rgb)
Rgb srgb_from_okhsl(const OkHsl &hsl)
float linear_from_srgb(float value, float gamma)
OkLab oklab_from_oklch(const OkLch &c)
Lin_rgb gamut_clip_adaptive_L0_0_5(const Lin_rgb &rgb, float alpha=0.05f)
An angle in both degrees and radians.
static constexpr An from_degrees(float degrees)
Represents a color with an alpha component. The color is stored in gamma (non-linear) space (aka sRGB...
constexpr Color(const Rgb &a_rgb, float a_alpha=1.0f)
Represents a color in the sRGB color space.
Represents a linear sRGB color.
Represents a color in the OKhsl color space.
Represents a color in the OKhsv color space.
Represents a color in the OKlab color space.
Represents a color in the OKlch color space.
Represents color in gamma (non-linear) space (aka sRGB).
constexpr Rgb(float red, float green, float blue)