Ember
Loading...
Searching...
No Matches
EmberCore::Color Struct Reference

RGBA color with 8-bit components. More...

#include <Color.h>

Public Member Functions

 Color ()=default
 Color (uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)
uint32_t ToRGBA32 () const
bool operator== (const Color &other) const
bool operator!= (const Color &other) const

Static Public Member Functions

static Color FromRGB (uint8_t r, uint8_t g, uint8_t b)
static Color FromRGBA (uint8_t r, uint8_t g, uint8_t b, uint8_t a)
static Color FromRGBA32 (uint32_t rgba)

Public Attributes

uint8_t r = 0
uint8_t g = 0
uint8_t b = 0
uint8_t a = 255

Static Public Attributes

static const Color Black = Color::FromRGB(0, 0, 0)
static const Color White = Color::FromRGB(255, 255, 255)
static const Color Red = Color::FromRGB(255, 0, 0)
static const Color Green = Color::FromRGB(0, 255, 0)
static const Color Blue = Color::FromRGB(0, 0, 255)
static const Color Yellow = Color::FromRGB(255, 255, 0)
static const Color Cyan = Color::FromRGB(0, 255, 255)
static const Color Magenta = Color::FromRGB(255, 0, 255)
static const Color Gray = Color::FromRGB(128, 128, 128)
static const Color DarkGray = Color::FromRGB(64, 64, 64)
static const Color LightGray = Color::FromRGB(192, 192, 192)
static const Color Transparent = Color::FromRGBA(0, 0, 0, 0)

Detailed Description

RGBA color with 8-bit components.

Definition at line 10 of file Color.h.

Constructor & Destructor Documentation

◆ Color() [1/2]

EmberCore::Color::Color ( )
default

◆ Color() [2/2]

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

Definition at line 17 of file Color.h.

Member Function Documentation

◆ FromRGB()

Color EmberCore::Color::FromRGB ( uint8_t r,
uint8_t g,
uint8_t b )
inlinestatic

Definition at line 20 of file Color.h.

◆ FromRGBA()

Color EmberCore::Color::FromRGBA ( uint8_t r,
uint8_t g,
uint8_t b,
uint8_t a )
inlinestatic

Definition at line 22 of file Color.h.

◆ FromRGBA32()

Color EmberCore::Color::FromRGBA32 ( uint32_t rgba)
inlinestatic

Definition at line 25 of file Color.h.

◆ operator!=()

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

Definition at line 41 of file Color.h.

◆ operator==()

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

Definition at line 39 of file Color.h.

◆ ToRGBA32()

uint32_t EmberCore::Color::ToRGBA32 ( ) const
inline

Definition at line 34 of file Color.h.

Member Data Documentation

◆ a

uint8_t EmberCore::Color::a = 255

Definition at line 14 of file Color.h.

◆ b

uint8_t EmberCore::Color::b = 0

Definition at line 13 of file Color.h.

◆ Black

const Color EmberCore::Color::Black = Color::FromRGB(0, 0, 0)
static

Definition at line 44 of file Color.h.

◆ Blue

const Color EmberCore::Color::Blue = Color::FromRGB(0, 0, 255)
static

Definition at line 48 of file Color.h.

◆ Cyan

const Color EmberCore::Color::Cyan = Color::FromRGB(0, 255, 255)
static

Definition at line 50 of file Color.h.

◆ DarkGray

const Color EmberCore::Color::DarkGray = Color::FromRGB(64, 64, 64)
static

Definition at line 53 of file Color.h.

◆ g

uint8_t EmberCore::Color::g = 0

Definition at line 12 of file Color.h.

◆ Gray

const Color EmberCore::Color::Gray = Color::FromRGB(128, 128, 128)
static

Definition at line 52 of file Color.h.

◆ Green

const Color EmberCore::Color::Green = Color::FromRGB(0, 255, 0)
static

Definition at line 47 of file Color.h.

◆ LightGray

const Color EmberCore::Color::LightGray = Color::FromRGB(192, 192, 192)
static

Definition at line 54 of file Color.h.

◆ Magenta

const Color EmberCore::Color::Magenta = Color::FromRGB(255, 0, 255)
static

Definition at line 51 of file Color.h.

◆ r

uint8_t EmberCore::Color::r = 0

Definition at line 11 of file Color.h.

◆ Red

const Color EmberCore::Color::Red = Color::FromRGB(255, 0, 0)
static

Definition at line 46 of file Color.h.

◆ Transparent

const Color EmberCore::Color::Transparent = Color::FromRGBA(0, 0, 0, 0)
static

Definition at line 55 of file Color.h.

◆ White

const Color EmberCore::Color::White = Color::FromRGB(255, 255, 255)
static

Definition at line 45 of file Color.h.

◆ Yellow

const Color EmberCore::Color::Yellow = Color::FromRGB(255, 255, 0)
static

Definition at line 49 of file Color.h.


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