ColorF
Description
A linear sRGB color value, with 32-bit floating-point precision for the color and alpha channels.
The color channel values (red, green and blue) are expected to be specified in linear sRGB color space (e.g. without gamma compression). This assumption is necessary, since the ColorF class uses linear arithmetic on color channel values.
Alpha channel values are always treated as linear.
Public / Methods
FromSrgbF
Transforms the given compressed sRGB color channel value into a linear sRGB color channel value.
This method uses the exact sRGB formula, which can decrease performance when used in tight loops.
- See also
FromSrgbI
Transforms the given compressed sRGB color channel value into a linear sRGB color channel value.
This method uses a look-up table, which provides good performance, even if used in tight loops. Color channel values less than 0
resp. greater than 65535
are clamped to the respective bound.
- See also
Mul
2 overloads
Modulates this color with the given one.
Modulates this color with the given value, excluding the alpha channel.
Round16
Rounds and clamps this color value so that calling ToARGB64 and FromARGB64 in sequence will yield the same ColorF value.
Round8
Rounds and clamps this color value so that calling ToARGB32 and FromARGB32 in sequence will yield the same ColorF value.
ToSrgbF
Transforms the given linear sRGB color channel value into a compressed sRGB color channel value.
This method uses the exact sRGB formula, which can decrease performance when used in tight loops.
- See also
ToSrgbI
Transforms the given linear sRGB color channel value into a compressed sRGB color channel value.
This method uses a look-up table, which provides good performance, even if used in tight loops. Color channel values less than 0
resp. greater than 65535
are clamped to the respective bound.
- See also