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

Represents a 4 channel color: {Red, Green, Blue, Alpha}. TODO: channel values should be limited to the range 0.0 - 1.0. More...

#include <color.h>

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. \warn does not clamp values within the normalized range
 
bool operator== (const color &aOther) const
 equality semantics
 
bool operator!= (const color &aOther) const
 equality semantics
 
 color (const color &)=default
 copy semantics
 
coloroperator= (const color &acolor)=default
 copy semantics
 
 color (color &&)=default
 move semantics
 
coloroperator= (color &&acolor)=default
 move semantics
 
 color ()=default
 constructs a color as opaque black
 
 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
 opaque black color
 
static const color white
 opaque white color
 
static const color red
 opaque red color
 
static const color green
 opaque green color
 
static const color dark_green
 opaque dark green color
 
static const color blue
 opaque blue color
 
static const color deathly_pink
 
static const color cornflower_blue
 an opaque pastel blue color
 

Detailed Description

Represents a 4 channel color: {Red, Green, Blue, Alpha}. TODO: channel values should be limited to the range 0.0 - 1.0.

Member Data Documentation

◆ deathly_pink

const color gdk::color::deathly_pink
static

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: