#include <OpenGUI_Types.h>
Supports an alpha channel. The default color is White, with alpha = 1.0f
Public Member Functions | |
| Color (float R=1.0f, float G=1.0f, float B=1.0f, float A=1.0f) | |
| Constructor with optional in place initialization. | |
| void | clamp () |
| Clamps the color channels between 0.0f and 1.0f. | |
| void | normalize () |
| Normalizes the color channels by scaling the channel ranges to fall within 0.0f and 1.0f. | |
| bool | operator== (const Color &right) const |
| comparison operator | |
| bool | operator!= (const Color &right) const |
| comparison operator | |
Static Public Member Functions | |
| static Color | PresetRed () |
| Quickly generate a preset Color that is Red. | |
| static Color | PresetGreen () |
| Quickly generate a preset Color that is Green. | |
| static Color | PresetBlue () |
| Quickly generate a preset Color that is Blue. | |
| static Color | PresetWhite () |
| Quickly generate a preset Color that is White. | |
| static Color | PresetBlack () |
| Quickly generate a preset Color that is Black. | |
Public Attributes | |
| float | Red |
| Red Channel. | |
| float | Green |
| Green Channel. | |
| float | Blue |
| Blue Channel. | |
| float | Alpha |
| Alpha Channel. | |
| OpenGUI::Color::Color | ( | float | R = 1.0f, |
|
| float | G = 1.0f, |
|||
| float | B = 1.0f, |
|||
| float | A = 1.0f | |||
| ) | [inline] |
Constructor with optional in place initialization.
| void OpenGUI::Color::clamp | ( | ) | [inline] |
Clamps the color channels between 0.0f and 1.0f.
| void OpenGUI::Color::normalize | ( | ) | [inline] |
Normalizes the color channels by scaling the channel ranges to fall within 0.0f and 1.0f.
If all channels have an equal value, the result will be the identity Color (all channels == 1.0f)
| bool OpenGUI::Color::operator!= | ( | const Color & | right | ) | const [inline] |
comparison operator
| bool OpenGUI::Color::operator== | ( | const Color & | right | ) | const [inline] |
comparison operator
| static Color OpenGUI::Color::PresetBlack | ( | ) | [inline, static] |
Quickly generate a preset Color that is Black.
| static Color OpenGUI::Color::PresetBlue | ( | ) | [inline, static] |
Quickly generate a preset Color that is Blue.
| static Color OpenGUI::Color::PresetGreen | ( | ) | [inline, static] |
Quickly generate a preset Color that is Green.
| static Color OpenGUI::Color::PresetRed | ( | ) | [inline, static] |
Quickly generate a preset Color that is Red.
| static Color OpenGUI::Color::PresetWhite | ( | ) | [inline, static] |
Quickly generate a preset Color that is White.
| float OpenGUI::Color::Alpha |
Alpha Channel.
| float OpenGUI::Color::Blue |
Blue Channel.
| float OpenGUI::Color::Green |
Green Channel.
| float OpenGUI::Color::Red |
Red Channel.