Primitive color type used through the engine.
More...
#include <color.hpp>
|
constexpr | Color () |
|
constexpr | Color (float red, float green, float blue, float alpha=1.f) |
|
| ~Color ()=default |
|
constexpr uint32_t | get_value () const |
| Get the raw value of the color. More...
|
|
|
constexpr static Color | rgba8 (uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha) |
| Create a color from RGBA components. More...
|
|
constexpr static Color | rgb8 (uint8_t red, uint8_t green, uint8_t blue) |
| Create a color from RGB components. More...
|
|
constexpr static Color | argb32 (uint32_t argb) |
| Create a color from RGBA32 components. More...
|
|
constexpr static Color | rgb32 (uint32_t argb) |
| Create a color from RGB32 components. More...
|
|
constexpr static Color | abgr32 (uint32_t abgr) |
|
constexpr static Color | bgr32 (uint32_t abgr) |
|
constexpr static Color | lerp (Color color1, Color color2, float lamda) |
| Combine two colors with LERP. More...
|
|
constexpr static Color | get_random (size_t mod) |
|
|
float | r = 0.f |
|
float | g = 0.f |
|
float | b = 0.f |
|
float | a = 1.f |
|
Primitive color type used through the engine.
Definition at line 32 of file color.hpp.
◆ Color() [1/2]
constexpr Eng3D::Color::Color |
( |
| ) |
|
|
inlineconstexpr |
◆ Color() [2/2]
constexpr Eng3D::Color::Color |
( |
float |
red, |
|
|
float |
green, |
|
|
float |
blue, |
|
|
float |
alpha = 1.f |
|
) |
| |
|
inlineconstexpr |
◆ ~Color()
◆ abgr32()
constexpr static Color Eng3D::Color::abgr32 |
( |
uint32_t |
abgr | ) |
|
|
inlinestaticconstexpr |
◆ argb32()
constexpr static Color Eng3D::Color::argb32 |
( |
uint32_t |
argb | ) |
|
|
inlinestaticconstexpr |
Create a color from RGBA32 components.
- Parameters
-
- Returns
- Color Resulting color
Definition at line 78 of file color.hpp.
◆ bgr32()
constexpr static Color Eng3D::Color::bgr32 |
( |
uint32_t |
abgr | ) |
|
|
inlinestaticconstexpr |
◆ get_random()
constexpr static Color Eng3D::Color::get_random |
( |
size_t |
mod | ) |
|
|
inlinestaticconstexpr |
◆ get_value()
constexpr uint32_t Eng3D::Color::get_value |
( |
| ) |
const |
|
inlineconstexpr |
Get the raw value of the color.
- Returns
- uint32_t The raw value
Definition at line 107 of file color.hpp.
◆ lerp()
constexpr static Color Eng3D::Color::lerp |
( |
Color |
color1, |
|
|
Color |
color2, |
|
|
float |
lamda |
|
) |
| |
|
inlinestaticconstexpr |
Combine two colors with LERP.
- Parameters
-
- Returns
- Color Resulting color
Definition at line 121 of file color.hpp.
◆ rgb32()
constexpr static Color Eng3D::Color::rgb32 |
( |
uint32_t |
argb | ) |
|
|
inlinestaticconstexpr |
Create a color from RGB32 components.
- Parameters
-
- Returns
- Color Resulting color
Definition at line 89 of file color.hpp.
◆ rgb8()
constexpr static Color Eng3D::Color::rgb8 |
( |
uint8_t |
red, |
|
|
uint8_t |
green, |
|
|
uint8_t |
blue |
|
) |
| |
|
inlinestaticconstexpr |
Create a color from RGB components.
- Parameters
-
red | Red component |
green | Green component |
blue | Blue component |
- Returns
- Color Resulting color
Definition at line 71 of file color.hpp.
◆ rgba8()
constexpr static Color Eng3D::Color::rgba8 |
( |
uint8_t |
red, |
|
|
uint8_t |
green, |
|
|
uint8_t |
blue, |
|
|
uint8_t |
alpha |
|
) |
| |
|
inlinestaticconstexpr |
Create a color from RGBA components.
- Parameters
-
red | Red component |
green | Green component |
blue | Blue component |
alpha | Alpha component |
- Returns
- Color Resulting color
Definition at line 62 of file color.hpp.
float Eng3D::Color::a = 1.f |
float Eng3D::Color::b = 0.f |
float Eng3D::Color::g = 0.f |
float Eng3D::Color::r = 0.f |
The documentation for this struct was generated from the following file: