Otclient  14/8/2020
Color Class Reference

#include <color.h>

Collaboration diagram for Color:

Public Member Functions

 Color ()
 
 Color (uint32 rgba)
 
 Color (uint8 r, uint8 g, uint8 b, uint8 a=0xFF)
 
 Color (int r, int g, int b, int a=0xFF)
 
 Color (float r, float g, float b, float a=1.0f)
 
 Color (const std::string &coltext)
 
 Color (const Color &color)=default
 
uint8 a () const
 
uint8 b () const
 
uint8 g () const
 
uint8 r () const
 
float aF () const
 
float bF () const
 
float gF () const
 
float rF () const
 
uint32 rgba () const
 
void setRed (int r)
 
void setGreen (int g)
 
void setBlue (int b)
 
void setAlpha (int a)
 
void setRed (float r)
 
void setGreen (float g)
 
void setBlue (float b)
 
void setAlpha (float a)
 
void setRGBA (uint8 r, uint8 g, uint8 b, uint8 a=0xFF)
 
void setRGBA (uint32 rgba)
 
Color operator+ (const Color &other) const
 
Color operator- (const Color &other) const
 
Color operator* (float v) const
 
Color operator/ (float v) const
 
Coloroperator= (uint32_t rgba)
 
bool operator== (uint32_t rgba) const
 
Coloroperator= (const Color &other)
 
bool operator== (const Color &other) const
 
bool operator!= (const Color &other) const
 

Static Public Member Functions

static uint8 to8bit (const Color &color)
 
static Color from8bit (int color)
 

Static Public Attributes

static const Color alpha = 0x00000000U
 
static const Color white = 0xffffffff
 
static const Color black = 0xff000000
 
static const Color red = 0xff0000ff
 
static const Color darkRed = 0xff000080
 
static const Color green = 0xff00ff00
 
static const Color darkGreen = 0xff008000
 
static const Color blue = 0xffff0000
 
static const Color darkBlue = 0xff800000
 
static const Color pink = 0xffff00ff
 
static const Color darkPink = 0xff800080
 
static const Color yellow = 0xff00ffff
 
static const Color darkYellow = 0xff008080
 
static const Color teal = 0xffffff00
 
static const Color darkTeal = 0xff808000
 
static const Color gray = 0xffa0a0a0
 
static const Color darkGray = 0xff808080
 
static const Color lightGray = 0xffc0c0c0
 
static const Color orange = 0xff008cff
 

Detailed Description

Definition at line 32 of file color.h.

Constructor & Destructor Documentation

◆ Color() [1/7]

Color::Color ( )
inline

Definition at line 35 of file color.h.

Here is the caller graph for this function:

◆ Color() [2/7]

Color::Color ( uint32  rgba)
inline

Definition at line 36 of file color.h.

Here is the call graph for this function:

◆ Color() [3/7]

Color::Color ( uint8  r,
uint8  g,
uint8  b,
uint8  a = 0xFF 
)
inline

Definition at line 37 of file color.h.

◆ Color() [4/7]

Color::Color ( int  r,
int  g,
int  b,
int  a = 0xFF 
)
inline

Definition at line 38 of file color.h.

◆ Color() [5/7]

Color::Color ( float  r,
float  g,
float  b,
float  a = 1.0f 
)
inline

Definition at line 39 of file color.h.

◆ Color() [6/7]

Color::Color ( const std::string &  coltext)

Definition at line 46 of file color.cpp.

◆ Color() [7/7]

Color::Color ( const Color color)
default

Member Function Documentation

◆ a()

uint8 Color::a ( ) const
inline

Definition at line 44 of file color.h.

Here is the caller graph for this function:

◆ aF()

float Color::aF ( ) const
inline

Definition at line 49 of file color.h.

Here is the caller graph for this function:

◆ b()

uint8 Color::b ( ) const
inline

Definition at line 45 of file color.h.

Here is the caller graph for this function:

◆ bF()

float Color::bF ( ) const
inline

Definition at line 50 of file color.h.

Here is the caller graph for this function:

◆ from8bit()

static Color Color::from8bit ( int  color)
inlinestatic

Definition at line 90 of file color.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ g()

uint8 Color::g ( ) const
inline

Definition at line 46 of file color.h.

Here is the caller graph for this function:

◆ gF()

float Color::gF ( ) const
inline

Definition at line 51 of file color.h.

Here is the caller graph for this function:

◆ operator!=()

bool Color::operator!= ( const Color other) const
inline

Definition at line 80 of file color.h.

Here is the call graph for this function:

◆ operator*()

Color Color::operator* ( float  v) const
inline

Definition at line 72 of file color.h.

Here is the call graph for this function:

◆ operator+()

Color Color::operator+ ( const Color other) const
inline

Definition at line 69 of file color.h.

Here is the call graph for this function:

◆ operator-()

Color Color::operator- ( const Color other) const
inline

Definition at line 70 of file color.h.

Here is the call graph for this function:

◆ operator/()

Color Color::operator/ ( float  v) const
inline

Definition at line 73 of file color.h.

Here is the call graph for this function:

◆ operator=() [1/2]

Color& Color::operator= ( const Color other)
inline

Definition at line 78 of file color.h.

◆ operator=() [2/2]

Color& Color::operator= ( uint32_t  rgba)
inline

Definition at line 75 of file color.h.

Here is the call graph for this function:

◆ operator==() [1/2]

bool Color::operator== ( const Color other) const
inline

Definition at line 79 of file color.h.

Here is the call graph for this function:

◆ operator==() [2/2]

bool Color::operator== ( uint32_t  rgba) const
inline

Definition at line 76 of file color.h.

Here is the call graph for this function:

◆ r()

uint8 Color::r ( ) const
inline

Definition at line 47 of file color.h.

Here is the caller graph for this function:

◆ rF()

float Color::rF ( ) const
inline

Definition at line 52 of file color.h.

Here is the caller graph for this function:

◆ rgba()

uint32 Color::rgba ( ) const
inline

Definition at line 54 of file color.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setAlpha() [1/2]

void Color::setAlpha ( float  a)
inline

Definition at line 64 of file color.h.

Here is the call graph for this function:

◆ setAlpha() [2/2]

void Color::setAlpha ( int  a)
inline

Definition at line 59 of file color.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setBlue() [1/2]

void Color::setBlue ( float  b)
inline

Definition at line 63 of file color.h.

Here is the call graph for this function:

◆ setBlue() [2/2]

void Color::setBlue ( int  b)
inline

Definition at line 58 of file color.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setGreen() [1/2]

void Color::setGreen ( float  g)
inline

Definition at line 62 of file color.h.

Here is the call graph for this function:

◆ setGreen() [2/2]

void Color::setGreen ( int  g)
inline

Definition at line 57 of file color.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setRed() [1/2]

void Color::setRed ( float  r)
inline

Definition at line 61 of file color.h.

Here is the call graph for this function:

◆ setRed() [2/2]

void Color::setRed ( int  r)
inline

Definition at line 56 of file color.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setRGBA() [1/2]

void Color::setRGBA ( uint32  rgba)
inline

Definition at line 67 of file color.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setRGBA() [2/2]

void Color::setRGBA ( uint8  r,
uint8  g,
uint8  b,
uint8  a = 0xFF 
)
inline

Definition at line 66 of file color.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ to8bit()

static uint8 Color::to8bit ( const Color color)
inlinestatic

Definition at line 82 of file color.h.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ alpha

const Color Color::alpha = 0x00000000U
static

Definition at line 100 of file color.h.

◆ black

const Color Color::black = 0xff000000
static

Definition at line 102 of file color.h.

◆ blue

const Color Color::blue = 0xffff0000
static

Definition at line 107 of file color.h.

◆ darkBlue

const Color Color::darkBlue = 0xff800000
static

Definition at line 108 of file color.h.

◆ darkGray

const Color Color::darkGray = 0xff808080
static

Definition at line 116 of file color.h.

◆ darkGreen

const Color Color::darkGreen = 0xff008000
static

Definition at line 106 of file color.h.

◆ darkPink

const Color Color::darkPink = 0xff800080
static

Definition at line 110 of file color.h.

◆ darkRed

const Color Color::darkRed = 0xff000080
static

Definition at line 104 of file color.h.

◆ darkTeal

const Color Color::darkTeal = 0xff808000
static

Definition at line 114 of file color.h.

◆ darkYellow

const Color Color::darkYellow = 0xff008080
static

Definition at line 112 of file color.h.

◆ gray

const Color Color::gray = 0xffa0a0a0
static

Definition at line 115 of file color.h.

◆ green

const Color Color::green = 0xff00ff00
static

Definition at line 105 of file color.h.

◆ lightGray

const Color Color::lightGray = 0xffc0c0c0
static

Definition at line 117 of file color.h.

◆ orange

const Color Color::orange = 0xff008cff
static

Definition at line 118 of file color.h.

◆ pink

const Color Color::pink = 0xffff00ff
static

Definition at line 109 of file color.h.

◆ red

const Color Color::red = 0xff0000ff
static

Definition at line 103 of file color.h.

◆ teal

const Color Color::teal = 0xffffff00
static

Definition at line 113 of file color.h.

◆ white

const Color Color::white = 0xffffffff
static

Definition at line 101 of file color.h.

◆ yellow

const Color Color::yellow = 0xff00ffff
static

Definition at line 111 of file color.h.


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