3D City v-1.0
Computer Graphics Project
color Struct Reference

class that holds color with 8 bits per channel with 4 channels rgba. More...

#include <core.h>

Public Member Functions

 color ()
 
 color (uint8_t r)
 
 color (uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)
 
 color (const vec3 &in)
 
vec4 getcolor () const
 
vec3 getcolorVec3 () const
 
uint8_t r () const
 
uint8_t g () const
 
uint8_t b () const
 
uint8_t a () const
 
uint8_t & r ()
 
uint8_t & g ()
 
uint8_t & b ()
 
uint8_t & a ()
 
color operator* (const vec3 &in) const
 
void operator*= (const vec3 &in)
 
color operator* (const color &in) const
 
void operator*= (const color &in)
 
color operator+ (const color &in) const
 
void operator+= (const color &in)
 
color operator* (const float &in) const
 
void operator*= (const float &in)
 
bool operator== (const color &in)
 

Public Attributes

uint32_t col
 

Detailed Description

class that holds color with 8 bits per channel with 4 channels rgba.

Definition at line 165 of file core.h.

Constructor & Destructor Documentation

◆ color() [1/4]

color::color ( )
inline

Definition at line 167 of file core.h.

◆ color() [2/4]

color::color ( uint8_t  r)
inlineexplicit

Definition at line 168 of file core.h.

◆ color() [3/4]

color::color ( uint8_t  r,
uint8_t  g,
uint8_t  b,
uint8_t  a = 255 
)
inline

Definition at line 169 of file core.h.

◆ color() [4/4]

color::color ( const vec3 &  in)
inlineexplicit

Definition at line 170 of file core.h.

Member Function Documentation

◆ a() [1/2]

uint8_t & color::a ( )
inline

Definition at line 211 of file core.h.

◆ a() [2/2]

uint8_t color::a ( ) const
inline

Definition at line 194 of file core.h.

◆ b() [1/2]

uint8_t & color::b ( )
inline

Definition at line 207 of file core.h.

◆ b() [2/2]

uint8_t color::b ( ) const
inline

Definition at line 190 of file core.h.

◆ g() [1/2]

uint8_t & color::g ( )
inline

Definition at line 203 of file core.h.

◆ g() [2/2]

uint8_t color::g ( ) const
inline

Definition at line 186 of file core.h.

◆ getcolor()

vec4 color::getcolor ( ) const
inline

Definition at line 172 of file core.h.

◆ getcolorVec3()

vec3 color::getcolorVec3 ( ) const
inline

Definition at line 177 of file core.h.

◆ operator*() [1/3]

color color::operator* ( const color &  in) const
inline

Definition at line 232 of file core.h.

◆ operator*() [2/3]

color color::operator* ( const float &  in) const
inline

Definition at line 275 of file core.h.

◆ operator*() [3/3]

color color::operator* ( const vec3 &  in) const
inline

Definition at line 216 of file core.h.

◆ operator*=() [1/3]

void color::operator*= ( const color &  in)
inline

Definition at line 243 of file core.h.

◆ operator*=() [2/3]

void color::operator*= ( const float &  in)
inline

Definition at line 283 of file core.h.

◆ operator*=() [3/3]

void color::operator*= ( const vec3 &  in)
inline

Definition at line 224 of file core.h.

◆ operator+()

color color::operator+ ( const color &  in) const
inline

Definition at line 252 of file core.h.

◆ operator+=()

void color::operator+= ( const color &  in)
inline

Definition at line 262 of file core.h.

◆ operator==()

bool color::operator== ( const color &  in)
inline

Definition at line 293 of file core.h.

◆ r() [1/2]

uint8_t & color::r ( )
inline

Definition at line 199 of file core.h.

◆ r() [2/2]

uint8_t color::r ( ) const
inline

Definition at line 182 of file core.h.

Member Data Documentation

◆ col

uint32_t color::col

Definition at line 166 of file core.h.