libdonut  2.3.2
Application framework for cross-platform game development in C++20
Public Member Functions | Static Public Attributes | Friends | List of all members
donut::Color Class Reference

Normalized floating-point RGBA color type with 32 bits per component. More...

#include <donut/Color.hpp>

Public Member Functions

constexpr Color () noexcept=default
 Construct a transparent color with a value of 0 in all components. More...
 
constexpr Color (float r, float g, float b, float a=1.0f) noexcept
 Construct a color with given values for each component. More...
 
constexpr Color (double r, double g, double b, double a=1.0) noexcept
 Construct a color with given values for each component. More...
 
constexpr Color (u8 r, u8 g, u8 b, u8 a=255) noexcept
 Construct a color with given integer values for each component in the range 0-255, which will be normalized to the range 0-1. More...
 
constexpr Color (int r, int g, int b, int a=255) noexcept
 Construct a color with given integer values for each component in the range 0-255, which will be normalized to the range 0-1. More...
 
constexpr Color (vec3 rgb) noexcept
 Construct a color from a vector with 3 components, XYZ, that map to the color components RGB, respectively. More...
 
constexpr Color (vec4 rgba) noexcept
 Construct a color from a vector with 4 components, XYZW, that map to the color components RGBA, respectively. More...
 
constexpr Color (u8vec3 rgb) noexcept
 Construct a color from a vector with 3 integer components in the range 0-255, XYZ, that map to the normalized 0-1 color components RGB, respectively. More...
 
constexpr Color (u8vec4 rgba) noexcept
 Construct a color from a vector with 4 integer components in the range 0-255, XYZW, that map to the normalized 0-1 color components RGBA, respectively. More...
 
constexpr operator vec3 () const noexcept
 Convert the color to a vector with 3 components, XYZ, that are mapped from the color components RGB, respectively. More...
 
constexpr operator vec4 () const noexcept
 Convert the color to a vector with 4 components, XYZW, that are mapped from the color components RGBA, respectively. More...
 
constexpr operator dvec3 () const noexcept
 Convert the color to a vector with 3 components, XYZ, that are mapped from the color components RGB, respectively. More...
 
constexpr operator dvec4 () const noexcept
 Convert the color to a vector with 4 components, XYZW, that are mapped from the color components RGBA, respectively. More...
 
constexpr operator u8vec3 () const noexcept
 Convert the color to a vector with 3 components, XYZ, that are mapped from the color components RGB, respectively, which are clamped to the range 0-1 before being converted to 0-255. More...
 
constexpr operator u8vec4 () const noexcept
 Convert the color to a vector with 4 components, XYZW, that are mapped from the normalized color components RGBA, respectively, which are clamped to the range 0-1 before being converted to 0-255. More...
 
constexpr Coloroperator+= (const Color &other) noexcept
 Add the component values of another color to the respective component values of this color. More...
 
constexpr Coloroperator-= (const Color &other) noexcept
 Subtract the component values of another color from the respective component values of this color. More...
 
constexpr Coloroperator*= (const Color &other) noexcept
 Multiply the component values of this color with the respective component values of another color. More...
 
constexpr Coloroperator/= (const Color &other) noexcept
 Divide the component values of this color with the respective component values of another color. More...
 
constexpr Coloroperator*= (float scalar) noexcept
 Multiply each of the component values of this color by a scalar value. More...
 
constexpr Coloroperator/= (float scalar) noexcept
 Divide each of the component values of this color by a scalar value. More...
 
constexpr void setRedComponent (float newValue) noexcept
 Set the value of the red component of this color. More...
 
constexpr void setGreenComponent (float newValue) noexcept
 Set the value of the green component of this color. More...
 
constexpr void setBlueComponent (float newValue) noexcept
 Set the value of the blue component of this color. More...
 
constexpr void setAlphaComponent (float newValue) noexcept
 Set the value of the alpha component of this color. More...
 
constexpr float getRedComponent () const noexcept
 Get the value of the red component of this color. More...
 
constexpr float getGreenComponent () const noexcept
 Get the value of the green component of this color. More...
 
constexpr float getBlueComponent () const noexcept
 Get the value of the blue component of this color. More...
 
constexpr float getAlphaComponent () const noexcept
 Get the value of the alpha component of this color. More...
 

Static Public Attributes

static const Color INVISIBLE { 0, 0, 0, 0}
 
static const Color ALICE_BLUE {240, 248, 255, 255}
 
static const Color ANTIQUE_WHITE {250, 235, 215, 255}
 
static const Color AQUA { 0, 255, 255, 255}
 
static const Color AQUAMARINE {127, 255, 212, 255}
 
static const Color AZURE {240, 255, 255, 255}
 
static const Color BEIGE {245, 245, 220, 255}
 
static const Color BISQUE {255, 228, 196, 255}
 
static const Color BLACK { 0, 0, 0, 255}
 
static const Color BLANCHED_ALMOND {255, 235, 205, 255}
 
static const Color BLUE { 0, 0, 255, 255}
 
static const Color BLUE_VIOLET {138, 43, 226, 255}
 
static const Color BROWN {165, 42, 42, 255}
 
static const Color BURLY_WOOD {222, 184, 135, 255}
 
static const Color CADET_BLUE { 95, 158, 160, 255}
 
static const Color CHARTREUSE {127, 255, 0, 255}
 
static const Color CHOCOLATE {210, 105, 30, 255}
 
static const Color CORAL {255, 127, 80, 255}
 
static const Color CORNFLOWER_BLUE {100, 149, 237, 255}
 
static const Color CORNSILK {255, 248, 220, 255}
 
static const Color CRIMSON {220, 20, 60, 255}
 
static const Color CYAN { 0, 255, 255, 255}
 
static const Color DARK_BLUE { 0, 0, 139, 255}
 
static const Color DARK_CYAN { 0, 139, 139, 255}
 
static const Color DARK_GOLDEN_ROD {184, 134, 11, 255}
 
static const Color DARK_GRAY {169, 169, 169, 255}
 
static const Color DARK_GREY {169, 169, 169, 255}
 
static const Color DARK_GREEN { 0, 100, 0, 255}
 
static const Color DARK_KHAKI {189, 183, 107, 255}
 
static const Color DARK_MAGENTA {139, 0, 139, 255}
 
static const Color DARK_OLIVE_GREEN { 85, 107, 47, 255}
 
static const Color DARK_ORANGE {255, 140, 0, 255}
 
static const Color DARK_ORCHID {153, 50, 204, 255}
 
static const Color DARK_RED {139, 0, 0, 255}
 
static const Color DARK_SALMON {233, 150, 122, 255}
 
static const Color DARK_SEA_GREEN {143, 188, 143, 255}
 
static const Color DARK_SLATE_BLUE { 72, 61, 139, 255}
 
static const Color DARK_SLATE_GRAY { 47, 79, 79, 255}
 
static const Color DARK_SLATE_GREY { 47, 79, 79, 255}
 
static const Color DARK_TURQUOISE { 0, 206, 209, 255}
 
static const Color DARK_VIOLET {148, 0, 211, 255}
 
static const Color DEEP_PINK {255, 20, 147, 255}
 
static const Color DEEP_SKY_BLUE { 0, 191, 255, 255}
 
static const Color DIM_GRAY {105, 105, 105, 255}
 
static const Color DIM_GREY {105, 105, 105, 255}
 
static const Color DODGER_BLUE { 30, 144, 255, 255}
 
static const Color FIRE_BRICK {178, 34, 34, 255}
 
static const Color FLORAL_WHITE {255, 250, 240, 255}
 
static const Color FOREST_GREEN { 34, 139, 34, 255}
 
static const Color FUCHSIA {255, 0, 255, 255}
 
static const Color GAINSBORO {220, 220, 220, 255}
 
static const Color GHOST_WHITE {248, 248, 255, 255}
 
static const Color GOLD {255, 215, 0, 255}
 
static const Color GOLDEN_ROD {218, 165, 32, 255}
 
static const Color GRAY {128, 128, 128, 255}
 
static const Color GREY {128, 128, 128, 255}
 
static const Color GREEN { 0, 128, 0, 255}
 
static const Color GREEN_YELLOW {173, 255, 47, 255}
 
static const Color HONEY_DEW {240, 255, 240, 255}
 
static const Color HOT_PINK {255, 105, 180, 255}
 
static const Color INDIAN_RED {205, 92, 92, 255}
 
static const Color INDIGO { 75, 0, 130, 255}
 
static const Color IVORY {255, 255, 240, 255}
 
static const Color KHAKI {240, 230, 140, 255}
 
static const Color LAVENDER {230, 230, 250, 255}
 
static const Color LAVENDER_BLUSH {255, 240, 245, 255}
 
static const Color LAWN_GREEN {124, 252, 0, 255}
 
static const Color LEMON_CHIFFON {255, 250, 205, 255}
 
static const Color LIGHT_BLUE {173, 216, 230, 255}
 
static const Color LIGHT_CORAL {240, 128, 128, 255}
 
static const Color LIGHT_CYAN {224, 255, 255, 255}
 
static const Color LIGHT_GOLDEN_ROD_YELLOW {250, 250, 210, 255}
 
static const Color LIGHT_GRAY {211, 211, 211, 255}
 
static const Color LIGHT_GREY {211, 211, 211, 255}
 
static const Color LIGHT_GREEN {144, 238, 144, 255}
 
static const Color LIGHT_PINK {255, 182, 193, 255}
 
static const Color LIGHT_SALMON {255, 160, 122, 255}
 
static const Color LIGHT_SEA_GREEN { 32, 178, 170, 255}
 
static const Color LIGHT_SKY_BLUE {135, 206, 250, 255}
 
static const Color LIGHT_SLATE_GRAY {119, 136, 153, 255}
 
static const Color LIGHT_SLATE_GREY {119, 136, 153, 255}
 
static const Color LIGHT_STEEL_BLUE {176, 196, 222, 255}
 
static const Color LIGHT_YELLOW {255, 255, 224, 255}
 
static const Color LIME { 0, 255, 0, 255}
 
static const Color LIME_GREEN { 50, 205, 50, 255}
 
static const Color LINEN {250, 240, 230, 255}
 
static const Color MAGENTA {255, 0, 255, 255}
 
static const Color MAROON {128, 0, 0, 255}
 
static const Color MEDIUM_AQUA_MARINE {102, 205, 170, 255}
 
static const Color MEDIUM_BLUE { 0, 0, 205, 255}
 
static const Color MEDIUM_ORCHID {186, 85, 211, 255}
 
static const Color MEDIUM_PURPLE {147, 112, 219, 255}
 
static const Color MEDIUM_SEA_GREEN { 60, 179, 113, 255}
 
static const Color MEDIUM_SLATE_BLUE {123, 104, 238, 255}
 
static const Color MEDIUM_SPRING_GREEN { 0, 250, 154, 255}
 
static const Color MEDIUM_TURQUOISE { 72, 209, 204, 255}
 
static const Color MEDIUM_VIOLET_RED {199, 21, 133, 255}
 
static const Color MIDNIGHT_BLUE { 25, 25, 112, 255}
 
static const Color MINT_CREAM {245, 255, 250, 255}
 
static const Color MISTY_ROSE {255, 228, 225, 255}
 
static const Color MOCCASIN {255, 228, 181, 255}
 
static const Color NAVAJO_WHITE {255, 222, 173, 255}
 
static const Color NAVY { 0, 0, 128, 255}
 
static const Color OLD_LACE {253, 245, 230, 255}
 
static const Color OLIVE {128, 128, 0, 255}
 
static const Color OLIVE_DRAB {107, 142, 35, 255}
 
static const Color ORANGE {255, 165, 0, 255}
 
static const Color ORANGE_RED {255, 69, 0, 255}
 
static const Color ORCHID {218, 112, 214, 255}
 
static const Color PALE_GOLDEN_ROD {238, 232, 170, 255}
 
static const Color PALE_GREEN {152, 251, 152, 255}
 
static const Color PALE_TURQUOISE {175, 238, 238, 255}
 
static const Color PALE_VIOLET_RED {219, 112, 147, 255}
 
static const Color PAPAYA_WHIP {255, 239, 213, 255}
 
static const Color PEACH_PUFF {255, 218, 185, 255}
 
static const Color PERU {205, 133, 63, 255}
 
static const Color PINK {255, 192, 203, 255}
 
static const Color PLUM {221, 160, 221, 255}
 
static const Color POWDER_BLUE {176, 224, 230, 255}
 
static const Color PURPLE {128, 0, 128, 255}
 
static const Color REBECCA_PURPLE {102, 51, 153, 255}
 
static const Color RED {255, 0, 0, 255}
 
static const Color ROSY_BROWN {188, 143, 143, 255}
 
static const Color ROYAL_BLUE { 65, 105, 225, 255}
 
static const Color SADDLE_BROWN {139, 69, 19, 255}
 
static const Color SALMON {250, 128, 114, 255}
 
static const Color SANDY_BROWN {244, 164, 96, 255}
 
static const Color SEA_GREEN { 46, 139, 87, 255}
 
static const Color SEA_SHELL {255, 245, 238, 255}
 
static const Color SIENNA {160, 82, 45, 255}
 
static const Color SILVER {192, 192, 192, 255}
 
static const Color SKY_BLUE {135, 206, 235, 255}
 
static const Color SLATE_BLUE {106, 90, 205, 255}
 
static const Color SLATE_GRAY {112, 128, 144, 255}
 
static const Color SLATE_GREY {112, 128, 144, 255}
 
static const Color SNOW {255, 250, 250, 255}
 
static const Color SPRING_GREEN { 0, 255, 127, 255}
 
static const Color STEEL_BLUE { 70, 130, 180, 255}
 
static const Color TAN {210, 180, 140, 255}
 
static const Color TEAL { 0, 128, 128, 255}
 
static const Color THISTLE {216, 191, 216, 255}
 
static const Color TOMATO {255, 99, 71, 255}
 
static const Color TURQUOISE { 64, 224, 208, 255}
 
static const Color VIOLET {238, 130, 238, 255}
 
static const Color WHEAT {245, 222, 179, 255}
 
static const Color WHITE {255, 255, 255, 255}
 
static const Color WHITE_SMOKE {245, 245, 245, 255}
 
static const Color YELLOW {255, 255, 0, 255}
 
static const Color YELLOW_GREEN {154, 205, 50, 255}
 

Friends

Color operator+ (const Color &a)
 Get the component-wise additive identity of a color. More...
 
Color operator- (const Color &a)
 Get the component-wise additive inverse of a color. More...
 
Color operator+ (const Color &a, const Color &b)
 Get the result of component-wise addition between two colors. More...
 
Color operator- (const Color &a, const Color &b)
 Get the result of component-wise subtraction between two colors. More...
 
Color operator* (const Color &a, const Color &b)
 Get the result of component-wise multiplication between two colors. More...
 
Color operator/ (const Color &a, const Color &b)
 Get the result of component-wise division between two colors. More...
 
Color operator* (const Color &a, float b)
 Get the result of multiplication between a color and a scalar. More...
 
Color operator* (float a, const Color &b)
 Get the result of multiplication between a scalar and a color. More...
 
Color operator/ (const Color &a, float b)
 Get the result of division between a color and a scalar. More...
 
Color operator/ (float a, const Color &b)
 Get the result of division between a scalar and a color. More...
 

Detailed Description

Normalized floating-point RGBA color type with 32 bits per component.

Constructor & Destructor Documentation

◆ Color() [1/9]

constexpr donut::Color::Color ( )
constexprdefaultnoexcept

Construct a transparent color with a value of 0 in all components.

◆ Color() [2/9]

constexpr donut::Color::Color ( float  r,
float  g,
float  b,
float  a = 1.0f 
)
inlineconstexprnoexcept

Construct a color with given values for each component.

Parameters
rvalue of the red color component.
gvalue of the green color component.
bvalue of the blue color component.
avalue of the alpha component. Defaults to fully opaque, i.e. a value of 1.

◆ Color() [3/9]

constexpr donut::Color::Color ( double  r,
double  g,
double  b,
double  a = 1.0 
)
inlineconstexprnoexcept

Construct a color with given values for each component.

Parameters
rvalue of the red color component.
gvalue of the green color component.
bvalue of the blue color component.
avalue of the alpha component. Defaults to fully opaque, i.e. a value of 1.

◆ Color() [4/9]

constexpr donut::Color::Color ( u8  r,
u8  g,
u8  b,
u8  a = 255 
)
inlineconstexprnoexcept

Construct a color with given integer values for each component in the range 0-255, which will be normalized to the range 0-1.

Parameters
rvalue of the red color component, before normalization.
gvalue of the green color component.
bvalue of the blue color component.
avalue of the alpha component. Defaults to fully opaque, i.e. a value of 1.

◆ Color() [5/9]

constexpr donut::Color::Color ( int  r,
int  g,
int  b,
int  a = 255 
)
inlineconstexprnoexcept

Construct a color with given integer values for each component in the range 0-255, which will be normalized to the range 0-1.

Parameters
rvalue of the red color component, before normalization.
gvalue of the green color component.
bvalue of the blue color component.
avalue of the alpha component. Defaults to fully opaque, i.e. a value of 1.

◆ Color() [6/9]

constexpr donut::Color::Color ( vec3  rgb)
inlineconstexprnoexcept

Construct a color from a vector with 3 components, XYZ, that map to the color components RGB, respectively.

The alpha component is set to fully opaque, i.e. a value of 1.

Parameters
rgbinput vector containing values for the red, green, and blue components.

◆ Color() [7/9]

constexpr donut::Color::Color ( vec4  rgba)
inlineconstexprnoexcept

Construct a color from a vector with 4 components, XYZW, that map to the color components RGBA, respectively.

Parameters
rgbainput vector containing values for the red, green, blue and alpha components.

◆ Color() [8/9]

constexpr donut::Color::Color ( u8vec3  rgb)
inlineconstexprnoexcept

Construct a color from a vector with 3 integer components in the range 0-255, XYZ, that map to the normalized 0-1 color components RGB, respectively.

The alpha component is set to fully opaque, i.e. a value of 1.

Parameters
rgbinput vector containing values for the red, green, and blue components.

◆ Color() [9/9]

constexpr donut::Color::Color ( u8vec4  rgba)
inlineconstexprnoexcept

Construct a color from a vector with 4 integer components in the range 0-255, XYZW, that map to the normalized 0-1 color components RGBA, respectively.

Parameters
rgbainput vector containing values for the red, green, blue and alpha components.

Member Function Documentation

◆ operator vec3()

constexpr donut::Color::operator vec3 ( ) const
inlineconstexprnoexcept

Convert the color to a vector with 3 components, XYZ, that are mapped from the color components RGB, respectively.

Returns
the RGB components of the color as a vector.

◆ operator vec4()

constexpr donut::Color::operator vec4 ( ) const
inlineconstexprnoexcept

Convert the color to a vector with 4 components, XYZW, that are mapped from the color components RGBA, respectively.

Returns
the RGBA components of the color as a vector.

◆ operator dvec3()

constexpr donut::Color::operator dvec3 ( ) const
inlineconstexprnoexcept

Convert the color to a vector with 3 components, XYZ, that are mapped from the color components RGB, respectively.

Returns
the RGB components of the color as a vector.

◆ operator dvec4()

constexpr donut::Color::operator dvec4 ( ) const
inlineconstexprnoexcept

Convert the color to a vector with 4 components, XYZW, that are mapped from the color components RGBA, respectively.

Returns
the RGBA components of the color as a vector.

◆ operator u8vec3()

constexpr donut::Color::operator u8vec3 ( ) const
inlineconstexprnoexcept

Convert the color to a vector with 3 components, XYZ, that are mapped from the color components RGB, respectively, which are clamped to the range 0-1 before being converted to 0-255.

Returns
the RGB components of the color as a vector.

◆ operator u8vec4()

constexpr donut::Color::operator u8vec4 ( ) const
inlineconstexprnoexcept

Convert the color to a vector with 4 components, XYZW, that are mapped from the normalized color components RGBA, respectively, which are clamped to the range 0-1 before being converted to 0-255.

Returns
the RGBA components of the color as a vector.

◆ operator+=()

constexpr Color& donut::Color::operator+= ( const Color other)
inlineconstexprnoexcept

Add the component values of another color to the respective component values of this color.

Parameters
otherthe other color to add to this color.
Returns
*this, for chaining.

◆ operator-=()

constexpr Color& donut::Color::operator-= ( const Color other)
inlineconstexprnoexcept

Subtract the component values of another color from the respective component values of this color.

Parameters
otherthe other color to subtract from this color.
Returns
*this, for chaining.

◆ operator*=() [1/2]

constexpr Color& donut::Color::operator*= ( const Color other)
inlineconstexprnoexcept

Multiply the component values of this color with the respective component values of another color.

Parameters
otherthe other color to multiply this color by.
Returns
*this, for chaining.

◆ operator/=() [1/2]

constexpr Color& donut::Color::operator/= ( const Color other)
inlineconstexprnoexcept

Divide the component values of this color with the respective component values of another color.

Parameters
otherthe other color to divide this color by.
Returns
*this, for chaining.

◆ operator*=() [2/2]

constexpr Color& donut::Color::operator*= ( float  scalar)
inlineconstexprnoexcept

Multiply each of the component values of this color by a scalar value.

Parameters
scalarthe scalar value to multiply this color by.
Returns
*this, for chaining.

◆ operator/=() [2/2]

constexpr Color& donut::Color::operator/= ( float  scalar)
inlineconstexprnoexcept

Divide each of the component values of this color by a scalar value.

Parameters
scalarthe scalar value to divide this color by.
Returns
*this, for chaining.

◆ setRedComponent()

constexpr void donut::Color::setRedComponent ( float  newValue)
inlineconstexprnoexcept

Set the value of the red component of this color.

Parameters
newValuenew value to set the red color component to.

◆ setGreenComponent()

constexpr void donut::Color::setGreenComponent ( float  newValue)
inlineconstexprnoexcept

Set the value of the green component of this color.

Parameters
newValuenew value to set the green color component to.

◆ setBlueComponent()

constexpr void donut::Color::setBlueComponent ( float  newValue)
inlineconstexprnoexcept

Set the value of the blue component of this color.

Parameters
newValuenew value to set the blue color component to.

◆ setAlphaComponent()

constexpr void donut::Color::setAlphaComponent ( float  newValue)
inlineconstexprnoexcept

Set the value of the alpha component of this color.

Parameters
newValuenew value to set the alpha component to.

◆ getRedComponent()

constexpr float donut::Color::getRedComponent ( ) const
inlineconstexprnoexcept

Get the value of the red component of this color.

Returns
the value of the red color component.

◆ getGreenComponent()

constexpr float donut::Color::getGreenComponent ( ) const
inlineconstexprnoexcept

Get the value of the green component of this color.

Returns
the value of the green color component.

◆ getBlueComponent()

constexpr float donut::Color::getBlueComponent ( ) const
inlineconstexprnoexcept

Get the value of the blue component of this color.

Returns
the value of the blue color component.

◆ getAlphaComponent()

constexpr float donut::Color::getAlphaComponent ( ) const
inlineconstexprnoexcept

Get the value of the alpha component of this color.

Returns
the value of the alpha component.

Friends And Related Function Documentation

◆ operator+ [1/2]

Color operator+ ( const Color a)
friend

Get the component-wise additive identity of a color.

Parameters
acolor to get the additive identity of.
Returns
the additive identity of the given color.

◆ operator- [1/2]

Color operator- ( const Color a)
friend

Get the component-wise additive inverse of a color.

Parameters
acolor to get the additive inverse of.
Returns
the additive inverse of the given color.

◆ operator+ [2/2]

Color operator+ ( const Color a,
const Color b 
)
friend

Get the result of component-wise addition between two colors.

Parameters
aleft-hand side of the addition.
bright-hand side of the addition.
Returns
a color containing a + b, component-wise.

◆ operator- [2/2]

Color operator- ( const Color a,
const Color b 
)
friend

Get the result of component-wise subtraction between two colors.

Parameters
aleft-hand side of the subtraction.
bright-hand side of the subtraction.
Returns
a color containing a - b, component-wise.

◆ operator* [1/3]

Color operator* ( const Color a,
const Color b 
)
friend

Get the result of component-wise multiplication between two colors.

Parameters
aleft-hand side of the multiplication.
bright-hand side of the multiplication.
Returns
a color containing a * b, component-wise.

◆ operator/ [1/3]

Color operator/ ( const Color a,
const Color b 
)
friend

Get the result of component-wise division between two colors.

Parameters
aleft-hand side of the division.
bright-hand side of the division.
Returns
a color containing a / b, component-wise.

◆ operator* [2/3]

Color operator* ( const Color a,
float  b 
)
friend

Get the result of multiplication between a color and a scalar.

Parameters
aleft-hand side of the multiplication.
bright-hand side of the multiplication.
Returns
a color containing the result of multiplying each component of a by b.

◆ operator* [3/3]

Color operator* ( float  a,
const Color b 
)
friend

Get the result of multiplication between a scalar and a color.

Parameters
aleft-hand side of the multiplication.
bright-hand side of the multiplication.
Returns
a color containing the result of multiplying a by each component of b.

◆ operator/ [2/3]

Color operator/ ( const Color a,
float  b 
)
friend

Get the result of division between a color and a scalar.

Parameters
aleft-hand side of the division.
bright-hand side of the division.
Returns
a color containing the result of dividing each component of a by b.

◆ operator/ [3/3]

Color operator/ ( float  a,
const Color b 
)
friend

Get the result of division between a scalar and a color.

Parameters
aleft-hand side of the division.
bright-hand side of the division.
Returns
a color containing the result of dividing a by each component of b.

Member Data Documentation

◆ INVISIBLE

constexpr Color donut::Color::INVISIBLE { 0, 0, 0, 0}
inlinestaticconstexpr

◆ ALICE_BLUE

constexpr Color donut::Color::ALICE_BLUE {240, 248, 255, 255}
inlinestaticconstexpr

◆ ANTIQUE_WHITE

constexpr Color donut::Color::ANTIQUE_WHITE {250, 235, 215, 255}
inlinestaticconstexpr

◆ AQUA

constexpr Color donut::Color::AQUA { 0, 255, 255, 255}
inlinestaticconstexpr

◆ AQUAMARINE

constexpr Color donut::Color::AQUAMARINE {127, 255, 212, 255}
inlinestaticconstexpr

◆ AZURE

constexpr Color donut::Color::AZURE {240, 255, 255, 255}
inlinestaticconstexpr

◆ BEIGE

constexpr Color donut::Color::BEIGE {245, 245, 220, 255}
inlinestaticconstexpr

◆ BISQUE

constexpr Color donut::Color::BISQUE {255, 228, 196, 255}
inlinestaticconstexpr

◆ BLACK

constexpr Color donut::Color::BLACK { 0, 0, 0, 255}
inlinestaticconstexpr

◆ BLANCHED_ALMOND

constexpr Color donut::Color::BLANCHED_ALMOND {255, 235, 205, 255}
inlinestaticconstexpr

◆ BLUE

constexpr Color donut::Color::BLUE { 0, 0, 255, 255}
inlinestaticconstexpr
Examples
example_game.cpp.

◆ BLUE_VIOLET

constexpr Color donut::Color::BLUE_VIOLET {138, 43, 226, 255}
inlinestaticconstexpr

◆ BROWN

constexpr Color donut::Color::BROWN {165, 42, 42, 255}
inlinestaticconstexpr

◆ BURLY_WOOD

constexpr Color donut::Color::BURLY_WOOD {222, 184, 135, 255}
inlinestaticconstexpr
Examples
example_game.cpp.

◆ CADET_BLUE

constexpr Color donut::Color::CADET_BLUE { 95, 158, 160, 255}
inlinestaticconstexpr

◆ CHARTREUSE

constexpr Color donut::Color::CHARTREUSE {127, 255, 0, 255}
inlinestaticconstexpr

◆ CHOCOLATE

constexpr Color donut::Color::CHOCOLATE {210, 105, 30, 255}
inlinestaticconstexpr

◆ CORAL

constexpr Color donut::Color::CORAL {255, 127, 80, 255}
inlinestaticconstexpr

◆ CORNFLOWER_BLUE

constexpr Color donut::Color::CORNFLOWER_BLUE {100, 149, 237, 255}
inlinestaticconstexpr

◆ CORNSILK

constexpr Color donut::Color::CORNSILK {255, 248, 220, 255}
inlinestaticconstexpr

◆ CRIMSON

constexpr Color donut::Color::CRIMSON {220, 20, 60, 255}
inlinestaticconstexpr

◆ CYAN

constexpr Color donut::Color::CYAN { 0, 255, 255, 255}
inlinestaticconstexpr

◆ DARK_BLUE

constexpr Color donut::Color::DARK_BLUE { 0, 0, 139, 255}
inlinestaticconstexpr

◆ DARK_CYAN

constexpr Color donut::Color::DARK_CYAN { 0, 139, 139, 255}
inlinestaticconstexpr

◆ DARK_GOLDEN_ROD

constexpr Color donut::Color::DARK_GOLDEN_ROD {184, 134, 11, 255}
inlinestaticconstexpr
Examples
example_game.cpp.

◆ DARK_GRAY

constexpr Color donut::Color::DARK_GRAY {169, 169, 169, 255}
inlinestaticconstexpr

◆ DARK_GREY

constexpr Color donut::Color::DARK_GREY {169, 169, 169, 255}
inlinestaticconstexpr

◆ DARK_GREEN

constexpr Color donut::Color::DARK_GREEN { 0, 100, 0, 255}
inlinestaticconstexpr

◆ DARK_KHAKI

constexpr Color donut::Color::DARK_KHAKI {189, 183, 107, 255}
inlinestaticconstexpr

◆ DARK_MAGENTA

constexpr Color donut::Color::DARK_MAGENTA {139, 0, 139, 255}
inlinestaticconstexpr

◆ DARK_OLIVE_GREEN

constexpr Color donut::Color::DARK_OLIVE_GREEN { 85, 107, 47, 255}
inlinestaticconstexpr

◆ DARK_ORANGE

constexpr Color donut::Color::DARK_ORANGE {255, 140, 0, 255}
inlinestaticconstexpr

◆ DARK_ORCHID

constexpr Color donut::Color::DARK_ORCHID {153, 50, 204, 255}
inlinestaticconstexpr

◆ DARK_RED

constexpr Color donut::Color::DARK_RED {139, 0, 0, 255}
inlinestaticconstexpr

◆ DARK_SALMON

constexpr Color donut::Color::DARK_SALMON {233, 150, 122, 255}
inlinestaticconstexpr

◆ DARK_SEA_GREEN

constexpr Color donut::Color::DARK_SEA_GREEN {143, 188, 143, 255}
inlinestaticconstexpr

◆ DARK_SLATE_BLUE

constexpr Color donut::Color::DARK_SLATE_BLUE { 72, 61, 139, 255}
inlinestaticconstexpr

◆ DARK_SLATE_GRAY

constexpr Color donut::Color::DARK_SLATE_GRAY { 47, 79, 79, 255}
inlinestaticconstexpr

◆ DARK_SLATE_GREY

constexpr Color donut::Color::DARK_SLATE_GREY { 47, 79, 79, 255}
inlinestaticconstexpr

◆ DARK_TURQUOISE

constexpr Color donut::Color::DARK_TURQUOISE { 0, 206, 209, 255}
inlinestaticconstexpr

◆ DARK_VIOLET

constexpr Color donut::Color::DARK_VIOLET {148, 0, 211, 255}
inlinestaticconstexpr

◆ DEEP_PINK

constexpr Color donut::Color::DEEP_PINK {255, 20, 147, 255}
inlinestaticconstexpr

◆ DEEP_SKY_BLUE

constexpr Color donut::Color::DEEP_SKY_BLUE { 0, 191, 255, 255}
inlinestaticconstexpr

◆ DIM_GRAY

constexpr Color donut::Color::DIM_GRAY {105, 105, 105, 255}
inlinestaticconstexpr

◆ DIM_GREY

constexpr Color donut::Color::DIM_GREY {105, 105, 105, 255}
inlinestaticconstexpr

◆ DODGER_BLUE

constexpr Color donut::Color::DODGER_BLUE { 30, 144, 255, 255}
inlinestaticconstexpr

◆ FIRE_BRICK

constexpr Color donut::Color::FIRE_BRICK {178, 34, 34, 255}
inlinestaticconstexpr

◆ FLORAL_WHITE

constexpr Color donut::Color::FLORAL_WHITE {255, 250, 240, 255}
inlinestaticconstexpr

◆ FOREST_GREEN

constexpr Color donut::Color::FOREST_GREEN { 34, 139, 34, 255}
inlinestaticconstexpr

◆ FUCHSIA

constexpr Color donut::Color::FUCHSIA {255, 0, 255, 255}
inlinestaticconstexpr

◆ GAINSBORO

constexpr Color donut::Color::GAINSBORO {220, 220, 220, 255}
inlinestaticconstexpr

◆ GHOST_WHITE

constexpr Color donut::Color::GHOST_WHITE {248, 248, 255, 255}
inlinestaticconstexpr

◆ GOLD

constexpr Color donut::Color::GOLD {255, 215, 0, 255}
inlinestaticconstexpr

◆ GOLDEN_ROD

constexpr Color donut::Color::GOLDEN_ROD {218, 165, 32, 255}
inlinestaticconstexpr

◆ GRAY

constexpr Color donut::Color::GRAY {128, 128, 128, 255}
inlinestaticconstexpr

◆ GREY

constexpr Color donut::Color::GREY {128, 128, 128, 255}
inlinestaticconstexpr

◆ GREEN

constexpr Color donut::Color::GREEN { 0, 128, 0, 255}
inlinestaticconstexpr
Examples
example_game.cpp.

◆ GREEN_YELLOW

constexpr Color donut::Color::GREEN_YELLOW {173, 255, 47, 255}
inlinestaticconstexpr

◆ HONEY_DEW

constexpr Color donut::Color::HONEY_DEW {240, 255, 240, 255}
inlinestaticconstexpr

◆ HOT_PINK

constexpr Color donut::Color::HOT_PINK {255, 105, 180, 255}
inlinestaticconstexpr

◆ INDIAN_RED

constexpr Color donut::Color::INDIAN_RED {205, 92, 92, 255}
inlinestaticconstexpr

◆ INDIGO

constexpr Color donut::Color::INDIGO { 75, 0, 130, 255}
inlinestaticconstexpr

◆ IVORY

constexpr Color donut::Color::IVORY {255, 255, 240, 255}
inlinestaticconstexpr

◆ KHAKI

constexpr Color donut::Color::KHAKI {240, 230, 140, 255}
inlinestaticconstexpr

◆ LAVENDER

constexpr Color donut::Color::LAVENDER {230, 230, 250, 255}
inlinestaticconstexpr

◆ LAVENDER_BLUSH

constexpr Color donut::Color::LAVENDER_BLUSH {255, 240, 245, 255}
inlinestaticconstexpr

◆ LAWN_GREEN

constexpr Color donut::Color::LAWN_GREEN {124, 252, 0, 255}
inlinestaticconstexpr

◆ LEMON_CHIFFON

constexpr Color donut::Color::LEMON_CHIFFON {255, 250, 205, 255}
inlinestaticconstexpr

◆ LIGHT_BLUE

constexpr Color donut::Color::LIGHT_BLUE {173, 216, 230, 255}
inlinestaticconstexpr

◆ LIGHT_CORAL

constexpr Color donut::Color::LIGHT_CORAL {240, 128, 128, 255}
inlinestaticconstexpr

◆ LIGHT_CYAN

constexpr Color donut::Color::LIGHT_CYAN {224, 255, 255, 255}
inlinestaticconstexpr

◆ LIGHT_GOLDEN_ROD_YELLOW

constexpr Color donut::Color::LIGHT_GOLDEN_ROD_YELLOW {250, 250, 210, 255}
inlinestaticconstexpr

◆ LIGHT_GRAY

constexpr Color donut::Color::LIGHT_GRAY {211, 211, 211, 255}
inlinestaticconstexpr

◆ LIGHT_GREY

constexpr Color donut::Color::LIGHT_GREY {211, 211, 211, 255}
inlinestaticconstexpr

◆ LIGHT_GREEN

constexpr Color donut::Color::LIGHT_GREEN {144, 238, 144, 255}
inlinestaticconstexpr

◆ LIGHT_PINK

constexpr Color donut::Color::LIGHT_PINK {255, 182, 193, 255}
inlinestaticconstexpr

◆ LIGHT_SALMON

constexpr Color donut::Color::LIGHT_SALMON {255, 160, 122, 255}
inlinestaticconstexpr

◆ LIGHT_SEA_GREEN

constexpr Color donut::Color::LIGHT_SEA_GREEN { 32, 178, 170, 255}
inlinestaticconstexpr

◆ LIGHT_SKY_BLUE

constexpr Color donut::Color::LIGHT_SKY_BLUE {135, 206, 250, 255}
inlinestaticconstexpr

◆ LIGHT_SLATE_GRAY

constexpr Color donut::Color::LIGHT_SLATE_GRAY {119, 136, 153, 255}
inlinestaticconstexpr

◆ LIGHT_SLATE_GREY

constexpr Color donut::Color::LIGHT_SLATE_GREY {119, 136, 153, 255}
inlinestaticconstexpr

◆ LIGHT_STEEL_BLUE

constexpr Color donut::Color::LIGHT_STEEL_BLUE {176, 196, 222, 255}
inlinestaticconstexpr

◆ LIGHT_YELLOW

constexpr Color donut::Color::LIGHT_YELLOW {255, 255, 224, 255}
inlinestaticconstexpr

◆ LIME

constexpr Color donut::Color::LIME { 0, 255, 0, 255}
inlinestaticconstexpr

◆ LIME_GREEN

constexpr Color donut::Color::LIME_GREEN { 50, 205, 50, 255}
inlinestaticconstexpr

◆ LINEN

constexpr Color donut::Color::LINEN {250, 240, 230, 255}
inlinestaticconstexpr

◆ MAGENTA

constexpr Color donut::Color::MAGENTA {255, 0, 255, 255}
inlinestaticconstexpr

◆ MAROON

constexpr Color donut::Color::MAROON {128, 0, 0, 255}
inlinestaticconstexpr

◆ MEDIUM_AQUA_MARINE

constexpr Color donut::Color::MEDIUM_AQUA_MARINE {102, 205, 170, 255}
inlinestaticconstexpr

◆ MEDIUM_BLUE

constexpr Color donut::Color::MEDIUM_BLUE { 0, 0, 205, 255}
inlinestaticconstexpr

◆ MEDIUM_ORCHID

constexpr Color donut::Color::MEDIUM_ORCHID {186, 85, 211, 255}
inlinestaticconstexpr

◆ MEDIUM_PURPLE

constexpr Color donut::Color::MEDIUM_PURPLE {147, 112, 219, 255}
inlinestaticconstexpr

◆ MEDIUM_SEA_GREEN

constexpr Color donut::Color::MEDIUM_SEA_GREEN { 60, 179, 113, 255}
inlinestaticconstexpr

◆ MEDIUM_SLATE_BLUE

constexpr Color donut::Color::MEDIUM_SLATE_BLUE {123, 104, 238, 255}
inlinestaticconstexpr

◆ MEDIUM_SPRING_GREEN

constexpr Color donut::Color::MEDIUM_SPRING_GREEN { 0, 250, 154, 255}
inlinestaticconstexpr

◆ MEDIUM_TURQUOISE

constexpr Color donut::Color::MEDIUM_TURQUOISE { 72, 209, 204, 255}
inlinestaticconstexpr

◆ MEDIUM_VIOLET_RED

constexpr Color donut::Color::MEDIUM_VIOLET_RED {199, 21, 133, 255}
inlinestaticconstexpr

◆ MIDNIGHT_BLUE

constexpr Color donut::Color::MIDNIGHT_BLUE { 25, 25, 112, 255}
inlinestaticconstexpr

◆ MINT_CREAM

constexpr Color donut::Color::MINT_CREAM {245, 255, 250, 255}
inlinestaticconstexpr

◆ MISTY_ROSE

constexpr Color donut::Color::MISTY_ROSE {255, 228, 225, 255}
inlinestaticconstexpr

◆ MOCCASIN

constexpr Color donut::Color::MOCCASIN {255, 228, 181, 255}
inlinestaticconstexpr

◆ NAVAJO_WHITE

constexpr Color donut::Color::NAVAJO_WHITE {255, 222, 173, 255}
inlinestaticconstexpr

◆ NAVY

constexpr Color donut::Color::NAVY { 0, 0, 128, 255}
inlinestaticconstexpr

◆ OLD_LACE

constexpr Color donut::Color::OLD_LACE {253, 245, 230, 255}
inlinestaticconstexpr

◆ OLIVE

constexpr Color donut::Color::OLIVE {128, 128, 0, 255}
inlinestaticconstexpr

◆ OLIVE_DRAB

constexpr Color donut::Color::OLIVE_DRAB {107, 142, 35, 255}
inlinestaticconstexpr

◆ ORANGE

constexpr Color donut::Color::ORANGE {255, 165, 0, 255}
inlinestaticconstexpr

◆ ORANGE_RED

constexpr Color donut::Color::ORANGE_RED {255, 69, 0, 255}
inlinestaticconstexpr

◆ ORCHID

constexpr Color donut::Color::ORCHID {218, 112, 214, 255}
inlinestaticconstexpr

◆ PALE_GOLDEN_ROD

constexpr Color donut::Color::PALE_GOLDEN_ROD {238, 232, 170, 255}
inlinestaticconstexpr

◆ PALE_GREEN

constexpr Color donut::Color::PALE_GREEN {152, 251, 152, 255}
inlinestaticconstexpr

◆ PALE_TURQUOISE

constexpr Color donut::Color::PALE_TURQUOISE {175, 238, 238, 255}
inlinestaticconstexpr

◆ PALE_VIOLET_RED

constexpr Color donut::Color::PALE_VIOLET_RED {219, 112, 147, 255}
inlinestaticconstexpr

◆ PAPAYA_WHIP

constexpr Color donut::Color::PAPAYA_WHIP {255, 239, 213, 255}
inlinestaticconstexpr

◆ PEACH_PUFF

constexpr Color donut::Color::PEACH_PUFF {255, 218, 185, 255}
inlinestaticconstexpr

◆ PERU

constexpr Color donut::Color::PERU {205, 133, 63, 255}
inlinestaticconstexpr

◆ PINK

constexpr Color donut::Color::PINK {255, 192, 203, 255}
inlinestaticconstexpr

◆ PLUM

constexpr Color donut::Color::PLUM {221, 160, 221, 255}
inlinestaticconstexpr

◆ POWDER_BLUE

constexpr Color donut::Color::POWDER_BLUE {176, 224, 230, 255}
inlinestaticconstexpr

◆ PURPLE

constexpr Color donut::Color::PURPLE {128, 0, 128, 255}
inlinestaticconstexpr

◆ REBECCA_PURPLE

constexpr Color donut::Color::REBECCA_PURPLE {102, 51, 153, 255}
inlinestaticconstexpr

◆ RED

constexpr Color donut::Color::RED {255, 0, 0, 255}
inlinestaticconstexpr

◆ ROSY_BROWN

constexpr Color donut::Color::ROSY_BROWN {188, 143, 143, 255}
inlinestaticconstexpr

◆ ROYAL_BLUE

constexpr Color donut::Color::ROYAL_BLUE { 65, 105, 225, 255}
inlinestaticconstexpr

◆ SADDLE_BROWN

constexpr Color donut::Color::SADDLE_BROWN {139, 69, 19, 255}
inlinestaticconstexpr

◆ SALMON

constexpr Color donut::Color::SALMON {250, 128, 114, 255}
inlinestaticconstexpr

◆ SANDY_BROWN

constexpr Color donut::Color::SANDY_BROWN {244, 164, 96, 255}
inlinestaticconstexpr

◆ SEA_GREEN

constexpr Color donut::Color::SEA_GREEN { 46, 139, 87, 255}
inlinestaticconstexpr

◆ SEA_SHELL

constexpr Color donut::Color::SEA_SHELL {255, 245, 238, 255}
inlinestaticconstexpr

◆ SIENNA

constexpr Color donut::Color::SIENNA {160, 82, 45, 255}
inlinestaticconstexpr

◆ SILVER

constexpr Color donut::Color::SILVER {192, 192, 192, 255}
inlinestaticconstexpr

◆ SKY_BLUE

constexpr Color donut::Color::SKY_BLUE {135, 206, 235, 255}
inlinestaticconstexpr

◆ SLATE_BLUE

constexpr Color donut::Color::SLATE_BLUE {106, 90, 205, 255}
inlinestaticconstexpr

◆ SLATE_GRAY

constexpr Color donut::Color::SLATE_GRAY {112, 128, 144, 255}
inlinestaticconstexpr

◆ SLATE_GREY

constexpr Color donut::Color::SLATE_GREY {112, 128, 144, 255}
inlinestaticconstexpr

◆ SNOW

constexpr Color donut::Color::SNOW {255, 250, 250, 255}
inlinestaticconstexpr

◆ SPRING_GREEN

constexpr Color donut::Color::SPRING_GREEN { 0, 255, 127, 255}
inlinestaticconstexpr

◆ STEEL_BLUE

constexpr Color donut::Color::STEEL_BLUE { 70, 130, 180, 255}
inlinestaticconstexpr

◆ TAN

constexpr Color donut::Color::TAN {210, 180, 140, 255}
inlinestaticconstexpr

◆ TEAL

constexpr Color donut::Color::TEAL { 0, 128, 128, 255}
inlinestaticconstexpr

◆ THISTLE

constexpr Color donut::Color::THISTLE {216, 191, 216, 255}
inlinestaticconstexpr

◆ TOMATO

constexpr Color donut::Color::TOMATO {255, 99, 71, 255}
inlinestaticconstexpr

◆ TURQUOISE

constexpr Color donut::Color::TURQUOISE { 64, 224, 208, 255}
inlinestaticconstexpr

◆ VIOLET

constexpr Color donut::Color::VIOLET {238, 130, 238, 255}
inlinestaticconstexpr

◆ WHEAT

constexpr Color donut::Color::WHEAT {245, 222, 179, 255}
inlinestaticconstexpr

◆ WHITE

constexpr Color donut::Color::WHITE {255, 255, 255, 255}
inlinestaticconstexpr

◆ WHITE_SMOKE

constexpr Color donut::Color::WHITE_SMOKE {245, 245, 245, 255}
inlinestaticconstexpr

◆ YELLOW

constexpr Color donut::Color::YELLOW {255, 255, 0, 255}
inlinestaticconstexpr
Examples
example_game.cpp.

◆ YELLOW_GREEN

constexpr Color donut::Color::YELLOW_GREEN {154, 205, 50, 255}
inlinestaticconstexpr

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