Encode a linear color as the #RRGGBB swatch that displays it.
The quantized inverse of srgbHexToLinearColor, and the shared way to
write an IAutoMovieColor.hex label or a bare sRGB palette entry from a
triple. Without it the contract's promise that hex is derived from the
linear components is an obligation with nothing behind it, which is what left
every label in the product hand-typed and unchecked.
Components outside [0, 1] are clamped, because a swatch cannot represent
light the display cannot emit and the eight-bit form is the gamut. A
non-finite component is refused instead: it names no color at any exposure,
and rounding it would write NaN into a string that reads like a swatch.
Encode a linear color as the
#RRGGBBswatch that displays it.The quantized inverse of srgbHexToLinearColor, and the shared way to write an
IAutoMovieColor.hexlabel or a bare sRGB palette entry from a triple. Without it the contract's promise thathexis derived from the linear components is an obligation with nothing behind it, which is what left every label in the product hand-typed and unchecked.Components outside
[0, 1]are clamped, because a swatch cannot represent light the display cannot emit and the eight-bit form is the gamut. A non-finite component is refused instead: it names no color at any exposure, and rounding it would writeNaNinto a string that reads like a swatch.