Euphoria
Classes | Namespaces | Functions | Variables
colors.h File Reference
#include "base/angle.h"
#include "base/vec3.h"

Go to the source code of this file.

Classes

struct  eu::Rgb
 Represents color in gamma (non-linear) space (aka sRGB). More...
 
struct  eu::Lin_rgb
 Represents a linear sRGB color. More...
 
struct  eu::OkHsv
 Represents a color in the OKhsv color space. More...
 
struct  eu::OkHsl
 Represents a color in the OKhsl color space. More...
 
struct  eu::Hsl
 Represents a color in the sRGB color space. More...
 
struct  eu::OkLch
 Represents a color in the OKlch color space. More...
 
struct  eu::OkLab
 Represents a color in the OKlab color space. More...
 
struct  eu::Color
 Represents a color with an alpha component. The color is stored in gamma (non-linear) space (aka sRGB). More...
 

Namespaces

namespace  eu
 
namespace  eu::hues
 
namespace  eu::colors
 

Functions

float eu::linear_from_srgb (float value, float gamma)
 
Lin_rgb eu::linear_from_srgb (const Rgb &value, float gamma)
 
float eu::linear_from_srgb (float value)
 
Lin_rgb eu::linear_from_srgb (const Rgb &value)
 
float eu::srgb_from_linear (float value)
 
Rgb eu::srgb_from_linear (const Lin_rgb &value)
 
OkLab eu::oklab_from_linear (const Lin_rgb &c)
 
Lin_rgb eu::linear_from_oklab (const OkLab &c)
 
OkLch eu::oklch_from_oklab (const OkLab &c)
 
OkLab eu::oklab_from_oklch (const OkLch &c)
 
Lin_rgb eu::gamut_clip_preserve_chroma (const Lin_rgb &rgb)
 
Lin_rgb eu::gamut_clip_project_to_0_5 (const Lin_rgb &rgb)
 
Lin_rgb eu::gamut_clip_project_to_l_cusp (const Lin_rgb &rgb)
 
Lin_rgb eu::gamut_clip_adaptive_L0_0_5 (const Lin_rgb &rgb, float alpha=0.05f)
 
Lin_rgb eu::gamut_clip_adaptive_l0_l_cusp (const Lin_rgb &rgb, float alpha=0.05f)
 
Rgb eu::srgb_from_okhsv (const OkHsv &hsv)
 
OkHsv eu::okhsv_from_srgb (const Rgb &rgb)
 
Rgb eu::srgb_from_okhsl (const OkHsl &hsl)
 
OkHsl eu::okhsl_from_srgb (const Rgb &rgb)
 
Rgb eu::srgb_from_hsl (const Hsl &hsl)
 
Lin_rgb eu::keep_within (Lin_rgb c)
 
constexpr eu::Rgb eu::colors::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 color box
 
constexpr Hsl eu::colors::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 color box
 

Variables

constexpr eu::An eu::hues::red = An::from_degrees(0.0f)
 
constexpr eu::An eu::hues::orange = An::from_degrees(30.0f)
 
constexpr eu::An eu::hues::yellow = An::from_degrees(60.0f)
 
constexpr eu::An eu::hues::green = An::from_degrees(120.0f)
 
constexpr eu::An eu::hues::cyan = An::from_degrees(180.0f)
 
constexpr eu::An eu::hues::blue = An::from_degrees(240.0f)
 
constexpr eu::An eu::hues::magenta = An::from_degrees(300.0f)
 
constexpr auto eu::colors::white = eu::Rgb{1.0f, 1.0f, 1.0f}
 
constexpr auto eu::colors::black = eu::Rgb{0.0f, 0.0f, 0.0f}
 
constexpr eu::Rgb eu::colors::orange = rgb(230, 159, 0)
 
constexpr eu::Rgb eu::colors::blue_sky = rgb(86, 180, 233)
 
constexpr eu::Rgb eu::colors::green_bluish = rgb(0, 158, 115)
 
constexpr eu::Rgb eu::colors::yellow = rgb(240, 228, 66)
 
constexpr eu::Rgb eu::colors::blue = rgb(0, 114, 178)
 
constexpr eu::Rgb eu::colors::red_vermillion = rgb(213, 94, 0)
 
constexpr eu::Rgb eu::colors::purple_redish = rgb(204, 121, 167)