Object representing a RGBA color.
More...
#include <jngl/Rgba.hpp>
|
| constexpr | Rgba (float red, float green, float blue, float alpha) |
| |
|
| Rgba (float red, float green, float blue, Alpha alpha) |
| |
|
| Rgba (Rgb, Alpha) |
| |
| constexpr float | getRed () const |
| | 0.0f ... 1.0f
|
| |
|
void | setRed (float) |
| | 0.0f ... 1.0f
|
| |
| constexpr float | getGreen () const |
| | 0.0f ... 1.0fu
|
| |
|
void | setGreen (float) |
| | 0.0f ... 1.0f
|
| |
| constexpr float | getBlue () const |
| | 0.0f ... 1.0f
|
| |
|
void | setBlue (float) |
| | 0.0f ... 1.0f
|
| |
| constexpr float | getAlpha () const |
| | 0.0f ... 1.0f
|
| |
|
void | setAlpha (float) |
| | 0.0f ... 1.0f
|
| |
|
void | setAlpha (Alpha) |
| |
|
void | setRgb (Rgb color) |
| | Overwrites red, green and blue, but leaves the alpha value untouched.
|
| |
|
| operator Rgb () const |
| | Drops the alpha value.
|
| |
|
| static constexpr Rgba | u8 (uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha) |
| |
Object representing a RGBA color.
You can use the custom literal operator to create jngl::Rgba from HTML color codes. For example #68da4fee becomes:
Object representing a RGBA color.
Definition at line 22 of file Rgba.hpp.
◆ Rgba()
| Rgba |
( |
float | red, |
|
|
float | green, |
|
|
float | blue, |
|
|
float | alpha ) |
|
inlineconstexpr |
- Parameters
-
| red | 0.0f ... 1.0f |
| green | 0.0f ... 1.0f |
| blue | 0.0f ... 1.0f |
| alpha | 0.0f ... 1.0f |
Values over 1.0f will result in 1.0f and negatives will result in 0.0f.
Definition at line 30 of file Rgba.hpp.
◆ u8()
| static constexpr Rgba u8 |
( |
uint8_t | red, |
|
|
uint8_t | green, |
|
|
uint8_t | blue, |
|
|
uint8_t | alpha ) |
|
inlinestaticconstexpr |
◆ getRed()
0.0f ... 1.0f
Definition at line 42 of file Rgba.hpp.
◆ getGreen()
0.0f ... 1.0fu
Definition at line 49 of file Rgba.hpp.
◆ getBlue()
0.0f ... 1.0f
Definition at line 56 of file Rgba.hpp.
◆ getAlpha()
0.0f ... 1.0f
Definition at line 63 of file Rgba.hpp.
The documentation for this class was generated from the following file: