Symphony Of Empires
Eng3D::Color Struct Reference

Primitive color type used through the engine. More...

#include <color.hpp>

Public Member Functions

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...
 

Static Public Member Functions

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)
 

Public Attributes

float r = 0.f
 
float g = 0.f
 
float b = 0.f
 
float a = 1.f
 

Detailed Description

Primitive color type used through the engine.

Definition at line 32 of file color.hpp.

Constructor & Destructor Documentation

◆ Color() [1/2]

constexpr Eng3D::Color::Color ( )
inlineconstexpr

Definition at line 36 of file color.hpp.

Here is the caller graph for this function:

◆ Color() [2/2]

constexpr Eng3D::Color::Color ( float  red,
float  green,
float  blue,
float  alpha = 1.f 
)
inlineconstexpr

Definition at line 45 of file color.hpp.

◆ ~Color()

Eng3D::Color::~Color ( )
default

Member Function Documentation

◆ abgr32()

constexpr static Color Eng3D::Color::abgr32 ( uint32_t  abgr)
inlinestaticconstexpr

Definition at line 93 of file color.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ argb32()

constexpr static Color Eng3D::Color::argb32 ( uint32_t  argb)
inlinestaticconstexpr

Create a color from RGBA32 components.

Parameters
argbThe ARGB32 color
Returns
Color Resulting color

Definition at line 78 of file color.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bgr32()

constexpr static Color Eng3D::Color::bgr32 ( uint32_t  abgr)
inlinestaticconstexpr

Definition at line 101 of file color.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_random()

constexpr static Color Eng3D::Color::get_random ( size_t  mod)
inlinestaticconstexpr

Definition at line 128 of file color.hpp.

Here is the call graph for this function:

◆ 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
color1Color 1
color2Color 2
lamdaIntensity of merge in respect to Color 2
Returns
Color Resulting color

Definition at line 121 of file color.hpp.

Here is the caller graph for this function:

◆ rgb32()

constexpr static Color Eng3D::Color::rgb32 ( uint32_t  argb)
inlinestaticconstexpr

Create a color from RGB32 components.

Parameters
argbThe ARGB32 color
Returns
Color Resulting color

Definition at line 89 of file color.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rgb8()

constexpr static Color Eng3D::Color::rgb8 ( uint8_t  red,
uint8_t  green,
uint8_t  blue 
)
inlinestaticconstexpr

Create a color from RGB components.

Parameters
redRed component
greenGreen component
blueBlue component
Returns
Color Resulting color

Definition at line 71 of file color.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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
redRed component
greenGreen component
blueBlue component
alphaAlpha component
Returns
Color Resulting color

Definition at line 62 of file color.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ a

float Eng3D::Color::a = 1.f

Definition at line 34 of file color.hpp.

◆ b

float Eng3D::Color::b = 0.f

Definition at line 33 of file color.hpp.

◆ g

float Eng3D::Color::g = 0.f

Definition at line 33 of file color.hpp.

◆ r

float Eng3D::Color::r = 0.f

Definition at line 33 of file color.hpp.


The documentation for this struct was generated from the following file: