Base Framework
Public Types | Public Member Functions | List of all members
Color Class Reference

Color. More...

#include <base/ui/Color.h>

Public Types

enum  NamedColor {
  ALMOND_BLANCHED, AQUA, AQUAMARINE, AQUAMARINE_LIGHT,
  AQUAMARINE_MED, BEIGE
}
 

Public Member Functions

 Color () noexcept
 
 Color (NamedColor color) noexcept
 
 Color (uint32 _value) noexcept
 
 Color (uint8 gray) noexcept
 
 Color (uint8 red, uint8 green, uint8 blue) noexcept
 
 Color (const Color &copy) noexcept
 
Coloroperator= (const Color &assign) noexcept
 
bool operator== (const Color color) const noexcept
 
bool operator!= (const Color color) const noexcept
 
uint8 getRed () const noexcept
 
void setRed (uint8 _value) noexcept
 
uint8 getGreen () const noexcept
 
void setGreen (uint8 _value) noexcept
 
uint8 getBlue () const noexcept
 
void setBlue (uint8 _value) noexcept
 
unsigned int getGray () const noexcept
 
void setGray (uint8 _value) noexcept
 
uint32 getValue () const noexcept
 
 operator uint32 () const noexcept
 

Detailed Description

Color.

RGB color.

Version
1.0

Member Enumeration Documentation

◆ NamedColor

Named color.

Constructor & Destructor Documentation

◆ Color() [1/6]

Color::Color ( )
inlinenoexcept

Initializes color with unspecified value.

◆ Color() [2/6]

Color::Color ( NamedColor  color)
noexcept

Initializes color from name of color (e.g. YELLOW).

◆ Color() [3/6]

Color::Color ( uint32  _value)
inlinenoexcept

Initializes color from rgb value (e.g. 0x123456).

◆ Color() [4/6]

Color::Color ( uint8  gray)
inlinenoexcept

Initializes color as gray.

◆ Color() [5/6]

Color::Color ( uint8  red,
uint8  green,
uint8  blue 
)
inlinenoexcept
Parameters
redThe red component.
greenThe green component.
blueThe blue component.

◆ Color() [6/6]

Color::Color ( const Color copy)
inlinenoexcept

Initializes color form other color.

Member Function Documentation

◆ getBlue()

uint8 Color::getBlue ( ) const
inlinenoexcept

Returns the blue component.

◆ getGray()

unsigned int Color::getGray ( ) const
inlinenoexcept

Returns the gray value of the color (i.e. (red + green + blue + 1)/3).

◆ getGreen()

uint8 Color::getGreen ( ) const
inlinenoexcept

Returns the green component.

◆ getRed()

uint8 Color::getRed ( ) const
inlinenoexcept

Returns the red component.

◆ getValue()

uint32 Color::getValue ( ) const
inlinenoexcept

Returns the color as a value.

◆ operator uint32()

Color::operator uint32 ( ) const
inlinenoexcept

Returns the color as a value.

◆ operator!=()

bool Color::operator!= ( const Color  color) const
inlinenoexcept

Returns true if the colors are unequal.

◆ operator=()

Color& Color::operator= ( const Color assign)
inlinenoexcept

Assignment of color by color.

◆ operator==()

bool Color::operator== ( const Color  color) const
inlinenoexcept

Returns true if the colors are equal.

◆ setBlue()

void Color::setBlue ( uint8  _value)
inlinenoexcept

Sets the blue component.

◆ setGray()

void Color::setGray ( uint8  _value)
inlinenoexcept

Sets the color as gray.

◆ setGreen()

void Color::setGreen ( uint8  _value)
inlinenoexcept

Sets the green component.

◆ setRed()

void Color::setRed ( uint8  _value)
inlinenoexcept

Sets the red component.