Axle 0.1.0
A simple, lightweight C++ game framework built on top of Raylib.
 
Loading...
Searching...
No Matches
Axle::Color Class Reference

This class is used to represent a color in the RGBA format. More...

#include <color.h>

Public Member Functions

 Color (unsigned char r, unsigned char g, unsigned char b, unsigned char a)
 Construct a new Color object using RGBA values.
 
 Color (unsigned char r, unsigned char g, unsigned char b)
 Construct a new Color object using RGB values.
 
 Color ()
 Construct a new Color object.
 
 Color (ColorPreset preset)
 Construct a new Color object using a preset.
 
void setR (unsigned char r)
 Set the Red value of the color.
 
void setG (unsigned char g)
 Set the Green value of the color.
 
void setB (unsigned char b)
 Set the Blue value of the color.
 
void setA (unsigned char a)
 Set the Alpha value of the color.
 
void setColor (unsigned char r, unsigned char g, unsigned char b, unsigned char a)
 Set the color of the object using RGBA values.
 
void setColor (ColorPreset preset)
 Set the color of the object using a preset.
 
unsigned char getR () const
 Get the Red value of the color.
 
unsigned char getG () const
 Get the Green value of the color.
 
unsigned char getB () const
 Get the Blue value of the color.
 
unsigned char getA () const
 Get the Alpha value of the color.
 

Detailed Description

This class is used to represent a color in the RGBA format.

Constructor & Destructor Documentation

◆ Color() [1/4]

Axle::Color::Color ( unsigned char r,
unsigned char g,
unsigned char b,
unsigned char a )

Construct a new Color object using RGBA values.

Parameters
rRed value (0-255)
gGreen value (0-255)
bBlue value (0-255)
aAlpha value (0-255)

◆ Color() [2/4]

Axle::Color::Color ( unsigned char r,
unsigned char g,
unsigned char b )

Construct a new Color object using RGB values.

Parameters
rRed value (0-255)
gGreen value (0-255)
bBlue value (0-255)
Note
The alpha value is set to 255

◆ Color() [3/4]

Axle::Color::Color ( )

Construct a new Color object.

Note
The color is set to transparent (0, 0, 0, 0)

◆ Color() [4/4]

Axle::Color::Color ( ColorPreset preset)

Construct a new Color object using a preset.

Parameters
presetColor preset

Member Function Documentation

◆ getA()

unsigned char Axle::Color::getA ( ) const

Get the Alpha value of the color.

Returns
unsigned char Alpha value (0-255)

◆ getB()

unsigned char Axle::Color::getB ( ) const

Get the Blue value of the color.

Returns
unsigned char Blue value (0-255)

◆ getG()

unsigned char Axle::Color::getG ( ) const

Get the Green value of the color.

Returns
unsigned char Green value (0-255)

◆ getR()

unsigned char Axle::Color::getR ( ) const

Get the Red value of the color.

Returns
unsigned char Red value (0-255)

◆ setA()

void Axle::Color::setA ( unsigned char a)

Set the Alpha value of the color.

Parameters
aAlpha value (0-255)

◆ setB()

void Axle::Color::setB ( unsigned char b)

Set the Blue value of the color.

Parameters
bBlue value (0-255)

◆ setColor() [1/2]

void Axle::Color::setColor ( ColorPreset preset)

Set the color of the object using a preset.

Parameters
presetColor preset

◆ setColor() [2/2]

void Axle::Color::setColor ( unsigned char r,
unsigned char g,
unsigned char b,
unsigned char a )

Set the color of the object using RGBA values.

Parameters
rRed value (0-255)
gGreen value (0-255)
bBlue value (0-255)
aAlpha value (0-255)

◆ setG()

void Axle::Color::setG ( unsigned char g)

Set the Green value of the color.

Parameters
gGreen value (0-255)

◆ setR()

void Axle::Color::setR ( unsigned char r)

Set the Red value of the color.

Parameters
rRed value (0-255)

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