1.1.0
Public Member Functions | Public Attributes | List of all members
fc::color Struct Reference

A wrapper class for fc_color. More...

#include <color.hpp>

Public Member Functions

 color ()
 
 color (fc_color const &c)
 Creates a fc::color instance from a fc_color value. More...
 
 color (color const &other)=default
 Default copy-constructor for fc::color. More...
 
 color (uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)
 Constructs a fc::color instance from red, green, blue and alpha components. More...
 
uint8_t r () const
 Gets the red component for this color. More...
 
uint8_t g () const
 Gets the green component for this color. More...
 
uint8_t b () const
 Gets the blue component for this color. More...
 
uint8_t a () const
 Gets the alpha component for this color. More...
 
colorr (uint8_t v)
 Sets the red component for this color. More...
 
colorg (uint8_t v)
 Sets the green component for this color. More...
 
colorb (uint8_t v)
 Sets the blue component for this color. More...
 
colora (uint8_t v)
 Sets the alpha component for this color. More...
 

Public Attributes

fc_color data
 The internal fc_color value.
 

Detailed Description

A wrapper class for fc_color.

Constructor & Destructor Documentation

◆ color() [1/4]

fc::color::color ( )
inline

Constructs a black, fully transparent color

◆ color() [2/4]

fc::color::color ( fc_color const &  c)
inline

Creates a fc::color instance from a fc_color value.

This constructor exists mainly to provide implicit automatic conversion from fc_font_size to fc::font_size

Parameters
cThe fc_color value to construct from

◆ color() [3/4]

fc::color::color ( color const &  other)
default

Default copy-constructor for fc::color.

Parameters
otherThe fc::color instance to copy from

◆ color() [4/4]

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

Constructs a fc::color instance from red, green, blue and alpha components.

Parameters
rThe red component
gThe green component
bThe blue component
aThe alpha component (default: 255, fully opaque)
See also
fc_color_set

Member Function Documentation

◆ r() [1/2]

uint8_t fc::color::r ( ) const
inline

Gets the red component for this color.

Returns
The red component for this color

◆ g() [1/2]

uint8_t fc::color::g ( ) const
inline

Gets the green component for this color.

Returns
The green component for this color

◆ b() [1/2]

uint8_t fc::color::b ( ) const
inline

Gets the blue component for this color.

Returns
The blue component for this color

◆ a() [1/2]

uint8_t fc::color::a ( ) const
inline

Gets the alpha component for this color.

Returns
The alpha component for this color

◆ r() [2/2]

color& fc::color::r ( uint8_t  v)
inline

Sets the red component for this color.

Returns
*this

◆ g() [2/2]

color& fc::color::g ( uint8_t  v)
inline

Sets the green component for this color.

Returns
*this

◆ b() [2/2]

color& fc::color::b ( uint8_t  v)
inline

Sets the blue component for this color.

Returns
*this

◆ a() [2/2]

color& fc::color::a ( uint8_t  v)
inline

Sets the alpha component for this color.

Returns
*this

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