Module color.rgb

Encoded and linear-light sRGB values.

Use SRgb for nonlinear sRGB channel values such as display- or image-facing data. Use LinearSRgb when an operation requires linear light. Convert explicitly with toLinear and toSRgb; neither conversion clips or gamut-maps extended values.

Functions

NameDescription
toLinear(color) Decodes an sRGB value for calculations that require linear light.
toSRgb(color) Encodes a linear-light value as nonlinear sRGB.

Structs

NameDescription
LinearSRgb Stores linear-light sRGB channel values.
SRgb Stores nonlinear sRGB channel values.

Aliases

NameTypeDescription
LinearSRgbd LinearSRgb!(double) Linear-light sRGB with double components.
LinearSRgbf LinearSRgb!(float) Linear-light sRGB with float components.
SRgbd SRgb!(double) Encoded sRGB with double components.
SRgbf SRgb!(float) Encoded sRGB with float components.