Represents a color.
More...
|
| Color () |
| Creates a color initialized to black. More...
|
|
| Color (ubyte r, ubyte g, ubyte b) |
| Create a color initialized to specified red, green, and blue components. More...
|
|
| Color (ubyte r, ubyte g, ubyte b, ubyte a) |
| Create a color initialized to specified red, green, blue and alpha components. More...
|
|
| Color (uint hexcolor) |
| Create a color initialized to specified red, green, blue, and alpha components. More...
|
|
bool | eq (Color other) |
| Does this Color equal another? More...
|
|
bool | neq (Color other) |
| Does this Color not equal another? More...
|
|
vec4f | toVector () |
| Construct and return a vec4f based on the red, green, blue and alpha components of this Color. More...
|
|
uint | toHex () |
| Gets a hex representation of this Color as a uint. Alpha is set to FF. More...
|
|
string | toHexString () |
| Gets a hex representation of this Color as a string. More...
|
|
bool | isBlack () |
| Is this Color black? More...
|
|
void | setSaturation (float newSaturation) |
| Adjust saturation based on 0.0 to 1.0 More...
|
|
|
static Color | colorFromARGB (int packedColor) |
| Creates a color struct from a packed integer in ARGB format. More...
|
|
static ubyte | convert (float value) |
| Scales a normalized value (between 0 and 1) to a ubyte (between 0 and 255), with clamping More...
|
|
static Color | lerp (Color first, Color second, double t) |
| Perform a linear interpolation between first and second. When t = 0, this returns first; when t = 1, this returns second. More...
|
|
static Color | fromVector (vec4f v) |
| Construct and return a color initialized to specified red, green, blue and alpha components. More...
|
|
static Color | fromHexWithAlpha (uint value) |
| Construct and return a color initialized to specified red, green, blue and alpha components. More...
|
|
AltusUnified::Color::Color |
( |
| ) |
|
Creates a color initialized to black.
AltusUnified::Color::Color |
( |
ubyte |
r, |
|
|
ubyte |
g, |
|
|
ubyte |
b |
|
) |
| |
Create a color initialized to specified red, green, and blue components.
- Parameters
-
r | Red component |
g | Green component |
b | Blue component |
AltusUnified::Color::Color |
( |
ubyte |
r, |
|
|
ubyte |
g, |
|
|
ubyte |
b, |
|
|
ubyte |
a |
|
) |
| |
Create a color initialized to specified red, green, blue and alpha components.
- Parameters
-
r | Red component |
g | Green component |
b | Blue component |
a | Alpha component |
AltusUnified::Color::Color |
( |
uint |
hexcolor | ) |
|
Create a color initialized to specified red, green, blue, and alpha components.
- Parameters
-
hexcolor | a hex color code as a uint |
static Color AltusUnified::Color::colorFromARGB |
( |
int |
packedColor | ) |
|
|
static |
Creates a color struct from a packed integer in ARGB format.
static ubyte AltusUnified::Color::convert |
( |
float |
value | ) |
|
|
static |
Scales a normalized value (between 0 and 1) to a ubyte (between 0 and 255), with clamping
bool AltusUnified::Color::eq |
( |
Color |
other | ) |
|
Does this Color equal another?
- Parameters
-
static Color AltusUnified::Color::fromHexWithAlpha |
( |
uint |
value | ) |
|
|
static |
Construct and return a color initialized to specified red, green, blue and alpha components.
static Color AltusUnified::Color::fromVector |
( |
vec4f |
v | ) |
|
|
static |
Construct and return a color initialized to specified red, green, blue and alpha components.
bool AltusUnified::Color::isBlack |
( |
| ) |
|
static Color AltusUnified::Color::lerp |
( |
Color |
first, |
|
|
Color |
second, |
|
|
double |
t |
|
) |
| |
|
static |
Perform a linear interpolation between first and second. When t = 0, this returns first; when t = 1, this returns second.
bool AltusUnified::Color::neq |
( |
Color |
other | ) |
|
Does this Color not equal another?
- Parameters
-
void AltusUnified::Color::setSaturation |
( |
float |
newSaturation | ) |
|
Adjust saturation based on 0.0 to 1.0
uint AltusUnified::Color::toHex |
( |
| ) |
|
Gets a hex representation of this Color as a uint. Alpha is set to FF.
string AltusUnified::Color::toHexString |
( |
| ) |
|
Gets a hex representation of this Color as a string.
vec4f AltusUnified::Color::toVector |
( |
| ) |
|
Construct and return a vec4f based on the red, green, blue and alpha components of this Color.
ubyte AltusUnified::Color::a |
ubyte AltusUnified::Color::b |
ubyte AltusUnified::Color::g |
ubyte AltusUnified::Color::r |