FIFE  be64c707dea6b3250bd4355bf5c825d25920087d
FIFE::Color Class Reference

#include <color.h>

+ Collaboration diagram for FIFE::Color:

Public Member Functions

 Color (uint8_t r=0, uint8_t g=0, uint8_t b=0, uint8_t alpha=255)
 Constructor. More...
 
 ~Color ()
 Destructor. More...
 
bool operator== (const Color &color) const
 Compares equality of two colors. More...
 
bool operator!= (const Color &color) const
 Compares unequality of two colors. More...
 
bool operator< (const Color &rhs) const
 Overload less operator. More...
 
void set (uint8_t r, uint8_t g, uint8_t b, uint8_t alpha)
 Set all color channel values. More...
 
void setR (uint8_t r)
 Set red channel value. More...
 
void setG (uint8_t g)
 Set green channel value. More...
 
void setB (uint8_t b)
 Set blue channel value. More...
 
void setAlpha (uint8_t alpha)
 Set alpha channel value. More...
 
uint8_t getR () const
 
uint8_t getG () const
 
uint8_t getB () const
 
uint8_t getAlpha () const
 

Private Attributes

uint8_t m_r
 
uint8_t m_g
 
uint8_t m_b
 
uint8_t m_a
 

Detailed Description

Definition at line 40 of file color.h.

Constructor & Destructor Documentation

◆ Color()

FIFE::Color::Color ( uint8_t  r = 0,
uint8_t  g = 0,
uint8_t  b = 0,
uint8_t  alpha = 255 
)

Constructor.

Parameters
rRed channel value.
gGreen channel value.
bBlue channel value.
alphaAlpha channel value.

Definition at line 38 of file color.cpp.

◆ ~Color()

FIFE::Color::~Color ( )

Destructor.

Definition at line 46 of file color.cpp.

Member Function Documentation

◆ getAlpha()

uint8_t FIFE::Color::getAlpha ( ) const
Returns
Alpha channel value.

Definition at line 84 of file color.cpp.

References m_a.

Referenced by FIFE::OverlayColors::changeColor(), and operator<().

+ Here is the caller graph for this function:

◆ getB()

uint8_t FIFE::Color::getB ( ) const
Returns
Blue channel value.

Definition at line 80 of file color.cpp.

References m_b.

Referenced by FIFE::OverlayColors::changeColor(), and operator<().

+ Here is the caller graph for this function:

◆ getG()

uint8_t FIFE::Color::getG ( ) const
Returns
Green channel value.

Definition at line 76 of file color.cpp.

References m_g.

Referenced by FIFE::OverlayColors::changeColor(), and operator<().

+ Here is the caller graph for this function:

◆ getR()

uint8_t FIFE::Color::getR ( ) const
Returns
Red channel value.

Definition at line 72 of file color.cpp.

References m_r.

Referenced by FIFE::OverlayColors::changeColor(), and operator<().

+ Here is the caller graph for this function:

◆ operator!=()

bool FIFE::Color::operator!= ( const Color color) const
inline

Compares unequality of two colors.

Definition at line 64 of file color.h.

◆ operator<()

bool FIFE::Color::operator< ( const Color rhs) const
inline

Overload less operator.

Definition at line 70 of file color.h.

References getAlpha(), getB(), getG(), getR(), m_a, m_b, m_g, m_r, setAlpha(), setB(), setG(), and setR().

◆ operator==()

bool FIFE::Color::operator== ( const Color color) const
inline

Compares equality of two colors.

Definition at line 58 of file color.h.

References m_a, m_b, m_g, and m_r.

◆ set()

void FIFE::Color::set ( uint8_t  r,
uint8_t  g,
uint8_t  b,
uint8_t  alpha 
)

Set all color channel values.

Parameters
rRed channel value.
gGreen channel value.
bBlue channel value.
alphaAlpha channel value.

Definition at line 49 of file color.cpp.

References m_a, m_b, m_g, and m_r.

Referenced by FIFE::OverlayColors::changeColor(), and FIFE::LibRocketRenderInterface::RenderGeometry().

+ Here is the caller graph for this function:

◆ setAlpha()

void FIFE::Color::setAlpha ( uint8_t  alpha)

Set alpha channel value.

Parameters
alphaNew value.

Definition at line 68 of file color.cpp.

References m_a.

Referenced by operator<().

+ Here is the caller graph for this function:

◆ setB()

void FIFE::Color::setB ( uint8_t  b)

Set blue channel value.

Parameters
bNew value.

Definition at line 64 of file color.cpp.

References m_b.

Referenced by operator<().

+ Here is the caller graph for this function:

◆ setG()

void FIFE::Color::setG ( uint8_t  g)

Set green channel value.

Parameters
gNew value.

Definition at line 60 of file color.cpp.

References m_g.

Referenced by operator<().

+ Here is the caller graph for this function:

◆ setR()

void FIFE::Color::setR ( uint8_t  r)

Set red channel value.

Parameters
rNew value.

Definition at line 56 of file color.cpp.

References m_r.

Referenced by operator<().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_a

uint8_t FIFE::Color::m_a
private

Definition at line 135 of file color.h.

Referenced by getAlpha(), operator<(), operator==(), set(), and setAlpha().

◆ m_b

uint8_t FIFE::Color::m_b
private

Definition at line 134 of file color.h.

Referenced by getB(), operator<(), operator==(), set(), and setB().

◆ m_g

uint8_t FIFE::Color::m_g
private

Definition at line 133 of file color.h.

Referenced by getG(), operator<(), operator==(), set(), and setG().

◆ m_r

uint8_t FIFE::Color::m_r
private

Definition at line 132 of file color.h.

Referenced by getR(), operator<(), operator==(), set(), and setR().


The documentation for this class was generated from the following files: