Jazz2::Editor::OkLab struct

A color in the Oklab color space, where distances follow how different colors look.

Public static functions

static auto FromPaletteEntry(std::uint32_t entry) -> OkLab
Converts a color of a palette, R | G << 8 | B << 16, alpha is ignored.
static auto Lerp(const OkLab& a, const OkLab& b, float t) -> OkLab
Returns a color between two others, t from 0 to 1.

Public functions

auto ToPaletteEntry(std::uint8_t alpha = 255) const -> std::uint32_t
Converts the color to an entry of a palette with a given alpha, colors outside of sRGB are clamped.
auto DistanceSquared(const OkLab& other) const -> float
Returns the squared distance to another color.

Public variables

float L
Lightness.
float A
Green to red.
float B
Blue to yellow.