ge211  2021.5.1
A student game engine
Color::HSVA Struct Reference

Detailed Description

Representation for the hue-saturation-value-alpha color model.

See Wikipedia for details on color models.

Definition at line 229 of file ge211_color.hxx.

Public Member Functions

 HSVA (double hue, double saturation, double value, double alpha=1.0)
 Constructs a hue-saturation-value-alpha color from its unit interval components.
 
Color to_rgba () const
 Converts color to the RGBA color model.
 
Transformations
HSVA rotate_hue (double degrees) const
 Returns a color by rotating the hue, leaving the other properties constant.
 
HSVA saturate (double unit_amount) const
 Produces a fuller tone by saturating the color. More...
 
HSVA desaturate (double unit_amount) const
 Produces a weaker tone by desaturating the color. More...
 
HSVA revalue (double unit_amount) const
 Produces a brighter color by increasing the value. More...
 
HSVA devalue (double unit_amount) const
 Produces a darker color by decreasing the value. More...
 
HSVA fade_in (double unit_amount) const
 Increases opacity of the color. More...
 
HSVA fade_out (double unit_amount) const
 Decreases opacity of the color. More...
 

Public Attributes

double hue
 The hue in degrees from 0 to 360. More...
 
double saturation
 The fullness of the color, from 0,0 (grey) to 1.0 (fully saturated).
 
double value
 The brightness of the color, from 0.0 (black) to 1.0 (fully colored).
 
double alpha
 The opacity of the color, from 0.0 (fully transparent) to 1.0 (fully opaque).
 

Member Function Documentation

◆ desaturate()

Color::HSVA desaturate ( double  unit_amount) const

Produces a weaker tone by desaturating the color.

The unit_amount must be between 0 and 1, where 0 leaves the color the same, and 1 produces gray at the same lightness as the original color.

Definition at line 273 of file ge211_color.cxx.

◆ devalue()

Color::HSVA devalue ( double  unit_amount) const

Produces a darker color by decreasing the value.

The unit_amount must be between 0 and 1, where 0 leaves the color the same, and 1 produces black.

Definition at line 283 of file ge211_color.cxx.

◆ fade_in()

Color::HSVA fade_in ( double  unit_amount) const

Increases opacity of the color.

The unit_amount must be between 0 and 1, where 0 leaves the color the same, and 1 produces a fully opaque color.

Definition at line 288 of file ge211_color.cxx.

◆ fade_out()

Color::HSVA fade_out ( double  unit_amount) const

Decreases opacity of the color.

The // unit_amount must be between 0 and 1, where 0 leaves the color the same, and 1 produces full transparency.

Definition at line 293 of file ge211_color.cxx.

◆ revalue()

Color::HSVA revalue ( double  unit_amount) const

Produces a brighter color by increasing the value.

The unit_amount must be between 0 and 1, where 0 leaves the color the same, and 1 produces a fully bright color.

Definition at line 278 of file ge211_color.cxx.

◆ saturate()

Color::HSVA saturate ( double  unit_amount) const

Produces a fuller tone by saturating the color.

The unit_amount must be between 0 and 1, where 0 leaves the color the same, and 1 produces a fully saturated color.

Definition at line 268 of file ge211_color.cxx.

Member Data Documentation

◆ hue

double hue

The hue in degrees from 0 to 360.

0° (and 360°) is red, 120° is green, and 240° is blue.

Definition at line 233 of file ge211_color.hxx.


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