StevEngine
StevEngine is a customizable C++ game engine.
Loading...
Searching...
No Matches
StevEngine::Utilities::Color Struct Reference

RGBA color representation. More...

#include <utilities/Color.hpp>

Public Member Functions

 Color (uint8_t r, uint8_t g, uint8_t b, uint8_t a)
 Create color with all channels.
 
 Color (uint8_t r, uint8_t g, uint8_t b)
 Create opaque color.
 
 Color (uint8_t v)
 Create grayscale color.
 
 Color ()
 Create white color.
 
const float * data () const
 Get color as float array.
 

Public Attributes

uint8_t r
 Red channel (0-255)
 
uint8_t g
 Green channel (0-255)
 
uint8_t b
 Blue channel (0-255)
 
uint8_t a
 Alpha channel (0-255)
 

Detailed Description

RGBA color representation.

Stores color data with 8 bits per channel. Provides conversions between byte and float formats.

Constructor & Destructor Documentation

◆ Color() [1/3]

StevEngine::Utilities::Color::Color ( uint8_t r,
uint8_t g,
uint8_t b,
uint8_t a )
inline

Create color with all channels.

Parameters
rRed value
gGreen value
bBlue value
aAlpha value

◆ Color() [2/3]

StevEngine::Utilities::Color::Color ( uint8_t r,
uint8_t g,
uint8_t b )
inline

Create opaque color.

Parameters
rRed value
gGreen value
bBlue value

◆ Color() [3/3]

StevEngine::Utilities::Color::Color ( uint8_t v)
inline

Create grayscale color.

Parameters
vGray value for RGB

Member Function Documentation

◆ data()

const float * StevEngine::Utilities::Color::data ( ) const

Get color as float array.

Returns
Array of normalized float values [r,g,b,a]

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