# Frost::Color Class Reference

Color container. More...

`#include <frost_utils_color.h>`

List of all members.

## Public Member Functions

| Color ()
| Default constructor.
| Color (const s_float &fR, const s_float &fG, const s_float &fB)
| Constructor.
| Color (const s_float &fA, const s_float &fR, const s_float &fG, const s_float &fB)
| Constructor.
| Color (const s_uint &uiColor)
| Constructor.
const s_float & | GetA () const
| Returns the alpha component.
const s_float & | GetR () const
| Returns the red component.
const s_float & | GetG () const
| Returns the green component.
const s_float & | GetB () const
| Returns the blue component.
s_uint | GetPacked () const
| Returns the packed ARGB value.
void | SetA (const s_float &fA)
| Sets the alpha component.
void | SetR (const s_float &fR)
| Sets the red component.
void | SetG (const s_float &fG)
| Sets the green component.
void | SetB (const s_float &fB)
| Sets the blue component.
void | SetPacked (const s_uint &uiColor)
| Sets the packed ARGB component.
void | Saturate ()
| Clamps color components to [0,1].
s_bool | IsNaN () const
| Sets if this Color has a NaN chanel.
s_float & | operator[] (const s_uint &uiIndex)
const s_float & | operator[] (const s_uint &uiIndex) const
s_bool | operator== (const Color &mColor) const
s_bool | operator!= (const Color &mColor) const
Color | operator* (const Color &mColor) const
Color | operator/ (const Color &mColor) const
Color | operator+ (const Color &mColor) const
Color | operator- (const Color &mColor) const
Color & | operator*= (const Color &mColor)
Color & | operator/= (const Color &mColor)
Color & | operator+= (const Color &mColor)
Color & | operator-= (const Color &mColor)
Color | operator* (const s_float &fValue) const
Color | operator/ (const s_float &fValue) const
void | operator*= (const s_float &fValue)
void | operator/= (const s_float &fValue)

## Static Public Member Functions

static Color | Random (const s_bool &bRandomAlpha=false)
| Creates a random color.
static Color | Saturate (const Color &mColor)
| Clamps color components to [0,1].

## Public Attributes

s_float | r
s_float | g
s_float | b
s_float | a

## Static Public Attributes

static const Color | BLACK
static const Color | WHITE
static const Color | RED
static const Color | GREEN
static const Color | BLUE
static const Color | VOID
static const Color | NaN
static const s_str | CLASS_NAME

## Private Member Functions

s_uint | BuildUIColor_ () const
void | BuildABGRColor_ (const s_uint &uiColor)

## Detailed Description

Color container.

Automatically builds ARGB packed color out of separated A, R, G and B values and vice versa.

Definition at line 26 of file frost_utils_color.h.

## Constructor & Destructor Documentation

Frost::Color::Color | ( |  | ) |

Default constructor.

Frost::Color::Color | ( | const s_float & | fR,
|  | const s_float & | fG,
|  | const s_float & | fB |
| ) |  |  |

Constructor.

Parameters:

  | fR | The red component
  | fG | The green component
  | fB | The blue component

Frost::Color::Color | ( | const s_float & | fA,
|  | const s_float & | fR,
|  | const s_float & | fG,
|  | const s_float & | fB |
| ) |  |  |

Constructor.

Parameters:

  | fA | The alpha component
  | fR | The green component
  | fG | The green component
  | fB | The blue component

Frost::Color::Color | ( | const s_uint & | uiColor | ) |

Constructor.

Parameters:

  | uiColor | The ARGB packed color

## Member Function Documentation

void Frost::Color::BuildABGRColor_ | ( | const s_uint & | uiColor | ) | `[private]`

s_uint Frost::Color::BuildUIColor_ | ( |  | ) | const`[private]`

const s_float& Frost::Color::GetA | ( |  | ) | const

Returns the alpha component.

Returns:
  The alpha component

const s_float& Frost::Color::GetB | ( |  | ) | const

Returns the blue component.

Returns:
  The blue component

const s_float& Frost::Color::GetG | ( |  | ) | const

Returns the green component.

Returns:
  The green component

s_uint Frost::Color::GetPacked | ( |  | ) | const

Returns the packed ARGB value.

Returns:
  The packed ARGB value

const s_float& Frost::Color::GetR | ( |  | ) | const

Returns the red component.

Returns:
  The red component

s_bool Frost::Color::IsNaN | ( |  | ) | const

Sets if this Color has a NaN chanel.

Returns:
  'true' if this Color has a NaN chanel

s_bool Frost::Color::operator!= | ( | const Color & | mColor | ) | const

Color Frost::Color::operator* | ( | const s_float & | fValue | ) | const

Color Frost::Color::operator* | ( | const Color & | mColor | ) | const

void Frost::Color::operator*= | ( | const s_float & | fValue | ) |

Color& Frost::Color::operator*= | ( | const Color & | mColor | ) |

Color Frost::Color::operator+ | ( | const Color & | mColor | ) | const

Color& Frost::Color::operator+= | ( | const Color & | mColor | ) |

Color Frost::Color::operator- | ( | const Color & | mColor | ) | const

Color& Frost::Color::operator-= | ( | const Color & | mColor | ) |

Color Frost::Color::operator/ | ( | const s_float & | fValue | ) | const

Color Frost::Color::operator/ | ( | const Color & | mColor | ) | const

void Frost::Color::operator/= | ( | const s_float & | fValue | ) |

Color& Frost::Color::operator/= | ( | const Color & | mColor | ) |

s_bool Frost::Color::operator== | ( | const Color & | mColor | ) | const

const s_float& Frost::Color::operator[] | ( | const s_uint & | uiIndex | ) | const

s_float& Frost::Color::operator[] | ( | const s_uint & | uiIndex | ) |

static Color Frost::Color::Random | ( | const s_bool & | bRandomAlpha = `false` | ) | `[static]`

Creates a random color.

Parameters:

  | bRandomAlpha | 'true' to randomize the alpha chanel too, 'false' to make it opaque (alpha = 255)

Returns:
  A random color

static Color Frost::Color::Saturate | ( | const Color & | mColor | ) | `[static]`

Clamps color components to [0,1].

Parameters:

  | mColor | The color to clamp

Returns:
  The clamped color

void Frost::Color::Saturate | ( |  | ) |

Clamps color components to [0,1].

void Frost::Color::SetA | ( | const s_float & | fA | ) |

Sets the alpha component.

Parameters:

  | fA | The alpha component

void Frost::Color::SetB | ( | const s_float & | fB | ) |

Sets the blue component.

Parameters:

  | fB | The blue component

void Frost::Color::SetG | ( | const s_float & | fG | ) |

Sets the green component.

Parameters:

  | fG | The green component

void Frost::Color::SetPacked | ( | const s_uint & | uiColor | ) |

Sets the packed ARGB component.

Parameters:

  | uiColor | packed ARGB component.

void Frost::Color::SetR | ( | const s_float & | fR | ) |

Sets the red component.

Parameters:

  | fR | The red component

## Member Data Documentation

s_float Frost::Color::a

Definition at line 174 of file frost_utils_color.h.

s_float Frost::Color::b

Definition at line 173 of file frost_utils_color.h.

const Color Frost::Color::BLACK`[static]`

Definition at line 161 of file frost_utils_color.h.

const Color Frost::Color::BLUE`[static]`

Definition at line 165 of file frost_utils_color.h.

const s_str Frost::Color::CLASS_NAME`[static]`

Definition at line 169 of file frost_utils_color.h.

s_float Frost::Color::g

Definition at line 172 of file frost_utils_color.h.

const Color Frost::Color::GREEN`[static]`

Definition at line 164 of file frost_utils_color.h.

const Color Frost::Color::NaN`[static]`

Definition at line 167 of file frost_utils_color.h.

s_float Frost::Color::r

Definition at line 171 of file frost_utils_color.h.

const Color Frost::Color::RED`[static]`

Definition at line 163 of file frost_utils_color.h.

const Color Frost::Color::VOID`[static]`

Definition at line 166 of file frost_utils_color.h.

const Color Frost::Color::WHITE`[static]`

Definition at line 162 of file frost_utils_color.h.

The documentation for this class was generated from the following file:

- D:/Programmation/Sources/Tensor2/Utils/include/frost_utils_color.h