gdk-graphics 0a0aef92e917cfbac53dffbc32c295e4de914093
Loading...
Searching...
No Matches
gdk::graphics::color Struct Referencefinal

Represents a 4 channel color: {Red, Green, Blue, Alpha}. More...

#include <color.h>

Collaboration diagram for gdk::graphics::color:

Public Types

using channel_type = float

Public Member Functions

void clamp ()
 clamp each channel to the [0 - 1] range
void operator+= (const color &aOther)
 add two colors together.
constexpr bool operator== (const color &aOther) const =default
 equality semantics
 color (const color &)=default
 copy semantics
color & operator= (const color &acolor)=default
 copy semantics
 color (color &&)=default
 move semantics
color & operator= (color &&acolor)=default
 move semantics
 color ()=default
 constructs a color as opaque black
constexpr color (const channel_type aR, const channel_type aG, const channel_type aB, const channel_type aA=1)
 constructs a color with provided channel values. Alpha has a default opaque value

Public Attributes

channel_type r = 0
channel_type g = 0
channel_type b = 0
channel_type a = 1

Static Public Attributes

special values
static const color black {0.0f, 0.0f, 0.0f, 1.0f}
 opaque black color
static const color white {1.0f, 1.0f, 1.0f, 1.0f}
 opaque white color
static const color red {1.0f, 0.0f, 0.0f, 1.0f}
 opaque red color
static const color green {0.0f, 1.0f, 0.0f, 1.0f}
 opaque green color
static const color dark_green {0.0f, 0.6f, 0.0f, 1.0f}
 opaque dark green color
static const color blue {0.0f, 0.0f, 1.0f, 1.0f}
 opaque blue color
static const color deathly_pink {1.0f, 0.2f, 0.8f, 1.0f}
static const color cornflower_blue
 an opaque pastel blue color

Detailed Description

Represents a 4 channel color: {Red, Green, Blue, Alpha}.

Member Function Documentation

◆ operator+=()

void gdk::graphics::color::operator+= ( const color & aOther)

add two colors together.

Warning
does not clamp values within the normalized range

Member Data Documentation

◆ cornflower_blue

const color gdk::graphics::color::cornflower_blue
inlinestatic
Initial value:
{
0.3921568627450980392156862745098f,
0.58431372549019607843137254901961f,
0.92941176470588235294117647058824f,
1.0f
}

an opaque pastel blue color

◆ deathly_pink

const color gdk::graphics::color::deathly_pink {1.0f, 0.2f, 0.8f, 1.0f}
inlinestatic

opaque bright pink color, useful for indicating color-related errors (stands out against most palettes)


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