|
| Color () noexcept |
| Construct with default values (opaque white.)
|
|
| Color (const Color &color) noexcept=default |
| Copy-construct from another color.
|
|
| Color (const Color &color, float a) noexcept |
| Construct from another color and modify the alpha.
|
|
| Color (float r, float g, float b) noexcept |
| Construct from RGB values and set alpha fully opaque.
|
|
| Color (float r, float g, float b, float a) noexcept |
| Construct from RGBA values.
|
|
| Color (const float *data) noexcept |
| Construct from a float array.
|
|
| Color (unsigned color, const ChannelMask &mask=ABGR) |
| Construct from 32-bit integer. Default format is 0xAABBGGRR.
|
|
| Color (const Vector3 &color) |
| Construct from 3-vector.
|
|
| Color (const Vector4 &color) |
| Construct from 4-vector.
|
|
Color & | operator= (const Color &rhs) noexcept=default |
| Assign from another color.
|
|
bool | operator== (const Color &rhs) const |
| Test for equality with another color without epsilon.
|
|
bool | operator!= (const Color &rhs) const |
| Test for inequality with another color without epsilon.
|
|
Color | operator* (float rhs) const |
| Multiply with a scalar.
|
|
Color | operator+ (const Color &rhs) const |
| Add a color.
|
|
Color | operator- () const |
| Return negation.
|
|
Color | operator- (const Color &rhs) const |
| Subtract a color.
|
|
Color & | operator+= (const Color &rhs) |
| Add-assign a color.
|
|
const float * | Data () const |
| Return float data.
|
|
unsigned | ToUInt () const |
| Return color packed to a 32-bit integer, with R component in the lowest 8 bits. Components are clamped to [0, 1] range.
|
|
unsigned | ToUIntMask (const ChannelMask &mask) const |
| Return color packed to a 32-bit integer with arbitrary channel mask. Components are clamped to [0, 1] range.
|
|
Vector3 | ToHSL () const |
| Return HSL color-space representation as a Vector3; the RGB values are clipped before conversion but not changed in the process.
|
|
Vector3 | ToHSV () const |
| Return HSV color-space representation as a Vector3; the RGB values are clipped before conversion but not changed in the process.
|
|
void | FromUInt (unsigned color) |
| Set RGBA values from packed 32-bit integer, with R component in the lowest 8 bits (format 0xAABBGGRR).
|
|
void | FromUIntMask (unsigned color, const ChannelMask &mask) |
| Set RGBA values from packed 32-bit integer with arbitrary channel mask.
|
|
void | FromHSL (float h, float s, float l, float a=1.0f) |
| Set RGBA values from specified HSL values and alpha.
|
|
void | FromHSV (float h, float s, float v, float a=1.0f) |
| Set RGBA values from specified HSV values and alpha.
|
|
Vector3 | ToVector3 () const |
| Return RGB as a three-dimensional vector.
|
|
Vector4 | ToVector4 () const |
| Return RGBA as a four-dimensional vector.
|
|
float | SumRGB () const |
| Return sum of RGB components.
|
|
float | Average () const |
| Return average value of the RGB channels.
|
|
float | Luma () const |
| Return the 'grayscale' representation of RGB values, as used by JPEG and PAL/NTSC among others.
|
|
float | Chroma () const |
| Return the colorfulness relative to the brightness of a similarly illuminated white.
|
|
float | Hue () const |
| Return hue mapped to range [0, 1.0).
|
|
float | SaturationHSL () const |
| Return saturation as defined for HSL.
|
|
float | SaturationHSV () const |
| Return saturation as defined for HSV.
|
|
float | Value () const |
| Return value as defined for HSV: largest value of the RGB components. Equivalent to calling MinRGB().
|
|
Color | GammaToLinear () const |
| Convert color from gamma to linear space.
|
|
Color | LinearToGamma () const |
| Convert color from linear to gamma space.
|
|
float | Lightness () const |
| Return lightness as defined for HSL: average of the largest and smallest values of the RGB components.
|
|
void | Bounds (float *min, float *max, bool clipped=false) const |
| Stores the values of least and greatest RGB component at specified pointer addresses, optionally clipping those values to [0, 1] range.
|
|
float | MaxRGB () const |
| Return the largest value of the RGB components.
|
|
float | MinRGB () const |
| Return the smallest value of the RGB components.
|
|
float | Range () const |
| Return range, defined as the difference between the greatest and least RGB component.
|
|
void | Clip (bool clipAlpha=false) |
| Clip to [0, 1.0] range.
|
|
void | Invert (bool invertAlpha=false) |
| Inverts the RGB channels and optionally the alpha channel as well.
|
|
Color | Lerp (const Color &rhs, float t) const |
| Return linear interpolation of this color with another color.
|
|
Color | Abs () const |
| Return color with absolute components.
|
|
bool | Equals (const Color &rhs) const |
| Test for equality with another color with epsilon.
|
|
String | ToString () const |
| Return as string.
|
|
unsigned | ToUIntArgb () const |
| Return color packed to a 32-bit integer, with B component in the lowest 8 bits. Components are clamped to [0, 1] range.
|
|
unsigned | ToHash () const |
| Return hash value for HashSet & HashMap.
|
|