smk::Color Namespace Reference

Color namespace. More...

Functions

glm::vec4 RGBA (float red, float green, float blue, float alpha)
 Build a color from its RGBA components components. This is equivalent to calling the glm::vec4 constructor. More...
 
glm::vec4 RGB (float red, float green, float blue)
 Build an opaque color from its RGB components components. More...
 

Variables

const glm::vec4 White = {1.F, 1.F, 1.F, 1.F}
 White. More...
 
const glm::vec4 Black = {0.F, 0.F, 0.F, 1.F}
 Black. More...
 
const glm::vec4 Grey = {.5f, .5f, .5f, 1.F}
 Grey. More...
 
const glm::vec4 Red = {1.F, 0.F, 0.F, 1.F}
 Red. More...
 
const glm::vec4 Green = {0.F, 1.F, 0.F, 1.F}
 Green. More...
 
const glm::vec4 Blue = {0.F, 0.F, 1.F, 1.F}
 Blue. More...
 
const glm::vec4 Yellow = {1.F, 1.F, 0.F, 1.F}
 Yellow. More...
 
const glm::vec4 Magenta = {1.F, 0.F, 1.F, 1.F}
 Magenta. More...
 
const glm::vec4 Cyan = {0.F, 1.F, 1.F, 1.F}
 Cyan. More...
 
const glm::vec4 Transparent = {0.F, 0.F, 0.F, 0.F}
 Transparent. More...
 

Detailed Description

Color namespace.

Function Documentation

◆ RGB()

glm::vec4 smk::Color::RGB ( float  red,
float  green,
float  blue 
)

Build an opaque color from its RGB components components.

Parameters
redThe red component in [0,1]
blueThe blue component in [0,1]
greenThe green component in [0,1]
Examples
bezier.cpp.

Definition at line 24 of file Color.cpp.

24 {
25 return {red, green, blue, 1.F};
26}

◆ RGBA()

glm::vec4 smk::Color::RGBA ( float  red,
float  green,
float  blue,
float  alpha 
)

Build a color from its RGBA components components. This is equivalent to calling the glm::vec4 constructor.

Parameters
redThe red component in [0,1]
blueThe blue component in [0,1]
greenThe green component in [0,1]
alphaThe alpha component in [0,1]

Definition at line 16 of file Color.cpp.

16 {
17 return {red, green, blue, alpha};
18}

Variable Documentation

◆ Black

const glm::vec4 smk::Color::Black = {0.F, 0.F, 0.F, 1.F}

◆ Blue

const glm::vec4 smk::Color::Blue = {0.F, 0.F, 1.F, 1.F}

Blue.

Examples
shape_2d.cpp.

Definition at line 34 of file Color.cpp.

◆ Cyan

const glm::vec4 smk::Color::Cyan = {0.F, 1.F, 1.F, 1.F}

Cyan.

Definition at line 37 of file Color.cpp.

◆ Green

const glm::vec4 smk::Color::Green = {0.F, 1.F, 0.F, 1.F}

Green.

Definition at line 33 of file Color.cpp.

◆ Grey

const glm::vec4 smk::Color::Grey = {.5f, .5f, .5f, 1.F}

Grey.

Definition at line 31 of file Color.cpp.

◆ Magenta

const glm::vec4 smk::Color::Magenta = {1.F, 0.F, 1.F, 1.F}

Magenta.

Definition at line 36 of file Color.cpp.

◆ Red

const glm::vec4 smk::Color::Red = {1.F, 0.F, 0.F, 1.F}

Red.

Examples
rounded_rectangle.cpp, shape_2d.cpp, and sound.cpp.

Definition at line 32 of file Color.cpp.

◆ Transparent

const glm::vec4 smk::Color::Transparent = {0.F, 0.F, 0.F, 0.F}

Transparent.

Definition at line 38 of file Color.cpp.

◆ White

const glm::vec4 smk::Color::White = {1.F, 1.F, 1.F, 1.F}

White.

Examples
sound.cpp.

Definition at line 29 of file Color.cpp.

◆ Yellow

const glm::vec4 smk::Color::Yellow = {1.F, 1.F, 0.F, 1.F}

Yellow.

Examples
bezier.cpp, and shape_2d.cpp.

Definition at line 35 of file Color.cpp.