nomlib
Loading...
Searching...
No Matches
nom::Color4< T > Struct Template Reference

RGBA color container. More...

#include <Color4.hpp>

Public Member Functions

 Color4 (void)
 Default constructor; initialize values to Color<T>::null.
 ~Color4 (void)
 Destructor.
template<typename U>
 Color4 (const Color4< U > &rhs)
 Copy constructor.
 Color4 (const Color4< float > &rhs)
 Copy constructor.
 Color4 (T r, T g, T b)
 Constructor variant for setting a color using RGB values.
 Color4 (T red, T green, T blue, T alpha)
 Constructor variant for setting a color using RGBA values.

Public Attributes

r
 Red component.
g
 Green component.
b
 Blue component.
a
 Alpha component.

Static Public Attributes

static const T ALPHA_TRANSPARENT
 100% transparent alpha channel value
static const T ALPHA_OPAQUE
 100% opaque alpha channel value
static const Color4 null
 Null value.
static const Color4 Transparent
 Primary colors.
static const Color4 Black
static const Color4 White
static const Color4 Red
static const Color4 Green
static const Color4 Blue
static const Color4 Yellow
static const Color4 Magenta
static const Color4 Cyan
static const Color4 Silver
 Additional colors.
static const Color4 Purple
static const Color4 Orange
static const Color4 LightGray
static const Color4 Gray
static const Color4 SkyBlue

Detailed Description

template<typename T>
struct nom::Color4< T >

RGBA color container.

Todo

Implement specialized Color4<float> operators

Explicitly initialize alpha component of static colors to 255.

Definition at line 59 of file Color4.hpp.

Constructor & Destructor Documentation

◆ Color4() [1/5]

template<typename T>
nom::Color4< T >::Color4 ( void )
inline

Default constructor; initialize values to Color<T>::null.

Definition at line 62 of file Color4.hpp.

◆ ~Color4()

template<typename T>
nom::Color4< T >::~Color4 ( void )
inline

Destructor.

Definition at line 72 of file Color4.hpp.

◆ Color4() [2/5]

template<typename T>
template<typename U>
nom::Color4< T >::Color4 ( const Color4< U > & rhs)
inline

Copy constructor.

Remarks
The explicit keyword here will result in compile-time errors in any instance that it finds incompatible casting occurring, such as if you try to down-cast a Color4<int16> to a Color4<uint8>.

Definition at line 83 of file Color4.hpp.

◆ Color4() [3/5]

template<typename T>
nom::Color4< T >::Color4 ( const Color4< float > & rhs)
inlineexplicit

Copy constructor.

Remarks
The explicit keyword here will result in compile-time errors in any instance that it finds incompatible casting occurring, such as if you try to down-cast a Color4<int16> to a Color4<uint8>.

Definition at line 97 of file Color4.hpp.

◆ Color4() [4/5]

template<typename T>
nom::Color4< T >::Color4 ( T r,
T g,
T b )
inline

Constructor variant for setting a color using RGB values.

Definition at line 107 of file Color4.hpp.

◆ Color4() [5/5]

template<typename T>
nom::Color4< T >::Color4 ( T red,
T green,
T blue,
T alpha )
inline

Constructor variant for setting a color using RGBA values.

Definition at line 117 of file Color4.hpp.

Member Data Documentation

◆ a

template<typename T>
T nom::Color4< T >::a

Alpha component.

Definition at line 171 of file Color4.hpp.

◆ ALPHA_OPAQUE

template<typename T>
const T nom::Color4< T >::ALPHA_OPAQUE
static

100% opaque alpha channel value

Definition at line 130 of file Color4.hpp.

◆ ALPHA_TRANSPARENT

template<typename T>
const T nom::Color4< T >::ALPHA_TRANSPARENT
static

100% transparent alpha channel value

Definition at line 127 of file Color4.hpp.

◆ b

template<typename T>
T nom::Color4< T >::b

Blue component.

Definition at line 168 of file Color4.hpp.

◆ Black

template<typename T>
const Color4 nom::Color4< T >::Black
static

Definition at line 142 of file Color4.hpp.

◆ Blue

template<typename T>
const Color4 nom::Color4< T >::Blue
static

Definition at line 146 of file Color4.hpp.

◆ Cyan

template<typename T>
const Color4 nom::Color4< T >::Cyan
static

Definition at line 149 of file Color4.hpp.

◆ g

template<typename T>
T nom::Color4< T >::g

Green component.

Definition at line 165 of file Color4.hpp.

◆ Gray

template<typename T>
const Color4 nom::Color4< T >::Gray
static

Definition at line 156 of file Color4.hpp.

◆ Green

template<typename T>
const Color4 nom::Color4< T >::Green
static

Definition at line 145 of file Color4.hpp.

◆ LightGray

template<typename T>
const Color4 nom::Color4< T >::LightGray
static

Definition at line 155 of file Color4.hpp.

◆ Magenta

template<typename T>
const Color4 nom::Color4< T >::Magenta
static

Definition at line 148 of file Color4.hpp.

◆ null

template<typename T>
const Color4 nom::Color4< T >::null
static

Null value.

Remarks
Null value implementation depends on signed (negative) numbers.

Definition at line 135 of file Color4.hpp.

◆ Orange

template<typename T>
const Color4 nom::Color4< T >::Orange
static

Definition at line 154 of file Color4.hpp.

◆ Purple

template<typename T>
const Color4 nom::Color4< T >::Purple
static

Definition at line 153 of file Color4.hpp.

◆ r

template<typename T>
T nom::Color4< T >::r

Red component.

Definition at line 162 of file Color4.hpp.

◆ Red

template<typename T>
const Color4 nom::Color4< T >::Red
static

Definition at line 144 of file Color4.hpp.

◆ Silver

template<typename T>
const Color4 nom::Color4< T >::Silver
static

Additional colors.

Definition at line 152 of file Color4.hpp.

◆ SkyBlue

template<typename T>
const Color4 nom::Color4< T >::SkyBlue
static

Definition at line 157 of file Color4.hpp.

◆ Transparent

template<typename T>
const Color4 nom::Color4< T >::Transparent
static

Primary colors.

Todo

Consider using Color4::Transparent instead of Color4::null.

Rename constants to ALL UPPERCASE.

Definition at line 141 of file Color4.hpp.

◆ White

template<typename T>
const Color4 nom::Color4< T >::White
static

Definition at line 143 of file Color4.hpp.

◆ Yellow

template<typename T>
const Color4 nom::Color4< T >::Yellow
static

Definition at line 147 of file Color4.hpp.


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