Ember
A C++ 20 'game engine' built with SDL3 with wide platform support.
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Color Struct Reference

Color struct. More...

#include <engine_structs.h>

Public Member Functions

glm::vec4 normalize_color () const
 
Color to_rgba (float r, float g, float b, float a) const
 
bool operator== (const Color &other) const
 

Public Attributes

unsigned char r
 
unsigned char g
 
unsigned char b
 
unsigned char a
 

Static Public Attributes

static const Color RED = {255, 0, 0, 255}
 
static const Color GREEN = {0, 255, 0, 255}
 
static const Color BLUE = {0, 0, 255, 255}
 
static const Color WHITE = {255, 255, 255, 255}
 
static const Color BLACK = {0, 0, 0, 255}
 
static const Color YELLOW = {255, 255, 0, 255}
 
static const Color CYAN = {0, 255, 255, 255}
 
static const Color MAGENTA = {255, 0, 255, 255}
 

Detailed Description

Color struct.

Works with HSV, RGBA, RGB and Normalized colors (0-1)

Version
0.0.1

Member Function Documentation

◆ normalize_color()

glm::vec4 Color::normalize_color ( ) const

◆ operator==()

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

◆ to_rgba()

Color Color::to_rgba ( float  r,
float  g,
float  b,
float  a 
) const

Member Data Documentation

◆ a

unsigned char Color::a

◆ b

unsigned char Color::b

◆ BLACK

const Color Color::BLACK = {0, 0, 0, 255}
static

◆ BLUE

const Color Color::BLUE = {0, 0, 255, 255}
static

◆ CYAN

const Color Color::CYAN = {0, 255, 255, 255}
static

◆ g

unsigned char Color::g

◆ GREEN

const Color Color::GREEN = {0, 255, 0, 255}
static

◆ MAGENTA

const Color Color::MAGENTA = {255, 0, 255, 255}
static

◆ r

unsigned char Color::r

◆ RED

const Color Color::RED = {255, 0, 0, 255}
static

◆ WHITE

const Color Color::WHITE = {255, 255, 255, 255}
static

◆ YELLOW

const Color Color::YELLOW = {255, 255, 0, 255}
static

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