Struct Oklab
Stores a color in Cartesian Oklab coordinates.
struct Oklab(T)
if (is(T == float) || is(T == double));
Use Oklab for perceptual calculations that need separate lightness and
opponent-color axes. T must be float or double. Construction
stores components unchanged; it does not clamp or canonicalize them.
The natural value contains NaNs and is not a usable color.
Fields
| Name | Type | Description |
|---|---|---|
a
|
T | Green-red opponent component. |
b
|
T | Blue-yellow opponent component. |
l
|
T | Perceptual lightness component. |
Aliases
| Name | Description |
|---|---|
Scalar
|
Scalar component type. |
Example
const lab = Oklabd(0.60, 0.10, -0.05);
assert(lab .l == 0.60);
assert(lab .a == 0.10);
assert(lab .b == -0.05);