Expand description
Math and color-space conversions shared by the dynamic color port.
Constants§
- WHITE_
POINT_ D65 - The D65 white point in XYZ: white on a sunny day.
Functions§
- argb_
from_ linrgb - Opaque ARGB from linear RGB channels in
0.0..=100.0. - argb_
from_ lstar - The gray with lightness
lstar. - argb_
from_ rgb - Opaque ARGB from 8-bit channels.
- argb_
from_ xyz - Opaque ARGB from XYZ.
- blue_
from_ argb - The blue channel of an ARGB color.
- clamp_
double inputlimited tomin..=max. Unlikef64::clampthis acceptsmin > max(returningminfor anything below it), which the 2025 color spec relies on and which must not panic.- delinearized
- A linear RGB channel in
0.0..=100.0as 8-bit sRGB, clamped. - difference_
degrees - The distance of two angles on a circle, in degrees.
- green_
from_ argb - The green channel of an ARGB color.
- lab_
from_ argb - Lab* of an ARGB color.
- lerp
startatamount0 andstopatamount1.- linearized
- An 8-bit sRGB channel as linear RGB in
0.0..=100.0. - lstar_
from_ argb - L* of an ARGB color.
- lstar_
from_ y - L* of a Y value.
- red_
from_ argb - The red channel of an ARGB color.
- rotation_
direction - The sign of the shortest rotation from one angle to another; 1 when they are exactly opposite.
- sanitize_
degrees_ double - An angle in
0.0..360.0. - sanitize_
degrees_ int - An integer angle in
0..360. - signum
- -1 below zero, 0 at zero, 1 above zero.
- xyz_
from_ argb - XYZ of an ARGB color.
- y_
from_ lstar - Y in XYZ (relative luminance) of an L* value.