RGBA color struct with 8-bit channels.
More...
#include <color.h>
|
| | Color () |
| | Construct a default Color (black, fully opaque).
|
| |
| | Color (uint8_t r, uint8_t g, uint8_t b, uint8_t a=255) |
| | Construct a Color from RGBA values.
|
| |
| SDL_Color | toSDLColor () const |
| | Convert to an SDL_Color.
|
| |
|
| uint8_t | r |
| |
| uint8_t | g |
| |
| uint8_t | b |
| |
| uint8_t | a |
| |
RGBA color struct with 8-bit channels.
Definition at line 11 of file color.h.
◆ Color() [1/2]
Construct a default Color (black, fully opaque).
Definition at line 15 of file color.h.
◆ Color() [2/2]
| asw::Color::Color |
( |
uint8_t | r, |
|
|
uint8_t | g, |
|
|
uint8_t | b, |
|
|
uint8_t | a = 255 ) |
|
inline |
Construct a Color from RGBA values.
- Parameters
-
| r | Red channel (0-255). |
| g | Green channel (0-255). |
| b | Blue channel (0-255). |
| a | Alpha channel (0-255, default 255). |
Definition at line 24 of file color.h.
◆ fromFloat()
| static Color asw::Color::fromFloat |
( |
float | r, |
|
|
float | g, |
|
|
float | b, |
|
|
float | a = 1.0F ) |
|
inlinestatic |
From float RGBA values (0.0-1.0) to Color.
- Parameters
-
| r | Red channel (0.0-1.0). |
| g | Green channel (0.0-1.0). |
| b | Blue channel (0.0-1.0). |
| a | Alpha channel (0.0-1.0, default 1.0). |
- Returns
- The equivalent Color.
Definition at line 41 of file color.h.
◆ fromHex()
| static Color asw::Color::fromHex |
( |
const std::string & | hex | ) |
|
|
inlinestatic |
From a hex string (e.g. "#RRGGBBAA") to a Color.
- Parameters
-
| hex | The hex string to convert. |
- Returns
- The equivalent Color.
Definition at line 58 of file color.h.
◆ fromSDLColor()
| static Color asw::Color::fromSDLColor |
( |
const SDL_Color & | sdlColor | ) |
|
|
inlinestatic |
Convert from an SDL_Color to a Color.
- Parameters
-
| sdlColor | The SDL_Color to convert. |
- Returns
- The equivalent Color.
Definition at line 49 of file color.h.
◆ toSDLColor()
| SDL_Color asw::Color::toSDLColor |
( |
| ) |
const |
|
inline |
Convert to an SDL_Color.
- Returns
- The equivalent SDL_Color.
Definition at line 31 of file color.h.
The documentation for this struct was generated from the following file: