Colobot
Loading...
Searching...
No Matches
Gfx::Color Struct Reference

RGBA color. More...

#include <src/graphics/core/color.h>

Public Member Functions

 Color (float aR=0.0f, float aG=0.0f, float aB=0.0f, float aA=0.0f)
 Constructor; default values are (0,0,0,0) = black.
Color Inverse () const
float * Array ()
 Returns the struct cast to float* array; use with care!
const float * Array () const
 Returns the struct cast to const float* array; use with care!
std::string ToString () const
 Returns a string (r, g, b, a).
bool operator== (const Color &other) const
bool operator!= (const Color &other) const
Color operator* (float scale) const

Public Attributes

float r
 Red, green, blue and alpha components.
float g
float b
float a

Detailed Description

RGBA color.

Constructor & Destructor Documentation

◆ Color()

Gfx::Color::Color ( float aR = 0.0f,
float aG = 0.0f,
float aB = 0.0f,
float aA = 0.0f )
inlineexplicit

Constructor; default values are (0,0,0,0) = black.

Member Function Documentation

◆ Array() [1/2]

float * Gfx::Color::Array ( )
inline

Returns the struct cast to float* array; use with care!

◆ Array() [2/2]

const float * Gfx::Color::Array ( ) const
inline

Returns the struct cast to const float* array; use with care!

◆ ToString()

std::string Gfx::Color::ToString ( ) const
inline

Returns a string (r, g, b, a).

Member Data Documentation

◆ r

float Gfx::Color::r

Red, green, blue and alpha components.


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