ge211
2021.5.1
A student game engine
|
|
3 #include "ge211_forward.hxx"
4 #include "ge211_noexcept.hxx"
6 #include <SDL_pixels.h>
41 uint8_t
alpha = 255) NOEXCEPT
50 double alpha = 1.0) NOEXCEPT;
60 return {255, 255, 255};
94 uint8_t
red() const NOEXCEPT {
return red_; };
96 uint8_t
green() const NOEXCEPT {
return green_; };
98 uint8_t
blue() const NOEXCEPT {
return blue_; };
100 uint8_t
alpha() const NOEXCEPT {
return alpha_; };
174 HSLA(
double hue,
double saturation,
175 double lightness,
double alpha = 1.0) NOEXCEPT;
178 Color to_rgba() const NOEXCEPT;
201 HSLA darken(
double unit_amount) const NOEXCEPT;
221 static
Color from_hsla(
double hue,
double saturation,
double lightness,
222 double alpha = 1) NOEXCEPT;
249 HSVA(
double hue,
double saturation,
250 double value,
double alpha = 1.0) NOEXCEPT;
253 Color to_rgba() const NOEXCEPT;
272 HSVA revalue(
double unit_amount) const NOEXCEPT;
276 HSVA devalue(
double unit_amount) const NOEXCEPT;
296 static
Color from_hsva(
double hue,
double saturation,
double value,
297 double alpha = 1) NOEXCEPT;
313 SDL_Color to_sdl_() const NOEXCEPT;
314 uint32_t to_sdl_(const SDL_PixelFormat*) const NOEXCEPT;
static Color medium_magenta()
Solid magenta.
HSLA to_hsla() const
Converts a color to the hue-saturation-lightness (HSL) color model.
double saturation
The fullness of the color, from 0.0 (grey) to 1.0 (fully saturated).
static Color from_rgba(double red, double green, double blue, double alpha=1.0)
Constructs a color with the given components.
constexpr Color(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha=255)
Constructs the color with the given components.
uint8_t green() const
Gets the green component of a color.
double alpha
The opacity of the color, from 0.0 (fully transparent) to 1.0 (fully opaque).
Color lighten(double unit_amount) const
Produces a tint by lightening the color.
Color fade_out(double unit_amount) const
Decreases opacity of the color.
uint8_t blue() const
Gets the blue component of a color.
static constexpr Color white()
Solid white.
The game engine namespace.
Representation for the hue-saturation-value-alpha color model.
Representation for the hue-saturation-lightness-alpha color model.
double hue
The hue in degrees from 0 to 360.
static Color medium_red()
Solid red.
uint8_t alpha() const
Gets the alpha (opacity) component of a color.
double alpha
The opacity of the color, from 0.0 (fully transparent) to 1.0 (fully opaque).
Color blend(double weight, Color that) const
Produces a blend of this color and that, with higher weight (between 0 and 1) increasing the level of...
A Sprite that displays text.
static Color medium_cyan()
Solid cyan.
uint8_t red() const
Gets the red component of a color.
double saturation
The fullness of the color, from 0,0 (grey) to 1.0 (fully saturated).
static Color medium_yellow()
Solid yellow.
static constexpr Color black()
Solid black.
A Render_sprite works by allowing its derived classes to render themselves pixel-by-pixel onto an SDL...
static Color medium_green()
Solid green.
Color darken(double unit_amount) const
Produces a shade by darkening the color.
Color rotate_hue(double degrees) const
Returns a color by rotating the hue, leaving the other properties constant.
static Color from_hsla(double hue, double saturation, double lightness, double alpha=1)
Constructs a color given the hue, saturation, lightness, and alpha.
static Color from_hsva(double hue, double saturation, double value, double alpha=1)
Constructs a color given the hue, saturation, value, and alpha.
constexpr Color()
Constructs the transparent color.
Color desaturate(double unit_amount) const
Produces a weaker tone by desaturating the color.
double lightness
The lightness of the color, from 0.0 (black) to 1.0 (white).
static Color medium_blue()
Solid blue.
double value
The brightness of the color, from 0.0 (black) to 1.0 (fully colored).
Color invert() const
Returns the inverse of a color.
HSVA to_hsva() const
Converts a color to the hue-saturation-value (HSV) color model.
Color saturate(double unit_amount) const
Produces a fuller tone by saturating the color.
double hue
The hue in degrees from 0 to 360.
Color fade_in(double unit_amount) const
Increases opacity of the color.