3 #include "ge211_forward.h" 5 #include <SDL_pixels.h> 40 uint8_t
alpha = 255) noexcept
49 double alpha = 1.0) noexcept;
59 return {255, 255, 255};
93 uint8_t
red() const noexcept {
return red_; };
95 uint8_t
green() const noexcept {
return green_; };
97 uint8_t
blue() const noexcept {
return blue_; };
99 uint8_t
alpha() const noexcept {
return alpha_; };
165 Color to_rgba() const noexcept;
188 HSLA darken(
double unit_amount) const noexcept;
208 static
Color from_hsla(
double hue,
double saturation,
double lightness,
209 double alpha = 1) noexcept;
231 Color to_rgba() const noexcept;
250 HSVA revalue(
double unit_amount) const noexcept;
254 HSVA devalue(
double unit_amount) const noexcept;
274 static
Color from_hsva(
double hue,
double saturation,
double value,
275 double alpha = 1) noexcept;
289 friend detail::Render_sprite;
291 SDL_Color to_sdl_() const noexcept;
292 uint32_t to_sdl_(const SDL_PixelFormat*) const noexcept;
static Color from_hsva(double hue, double saturation, double value, double alpha=1) noexcept
Constructs a color given the hue, saturation, value, and alpha.
Color invert() const noexcept
Returns the inverse of a color.
double saturation
The fullness of the color, from 0,0 (grey) to 1.0 (fully saturated).
double hue
The hue in degrees from 0 to 360.
uint8_t alpha() const noexcept
Gets the alpha (opacity) component of a color.
static Color medium_magenta() noexcept
Solid magenta.
double value
The brightness of the color, from 0.0 (black) to 1.0 (fully colored).
Representation for the hue-saturation-value-alpha color model.
HSVA to_hsva() const noexcept
Converts a color to the hue-saturation-value (HSV) color model.
Representation for the hue-saturation-lightness-alpha color model.
Color rotate_hue(double degrees) const noexcept
Returns a color by rotating the hue, leaving the other properties constant.
The game engine namespace.
Color fade_in(double unit_amount) const noexcept
Increases opacity of the color.
Color saturate(double unit_amount) const noexcept
Produces a fuller tone by saturating the color.
double lightness
The lightness of the color, from 0.0 (black) to 1.0 (white).
constexpr Color(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha=255) noexcept
Constructs the color with the given components.
HSLA to_hsla() const noexcept
Converts a color to the hue-saturation-lightness (HSL) color model.
Color darken(double unit_amount) const noexcept
Produces a shade by darkening the color.
static Color medium_red() noexcept
Solid red.
uint8_t blue() const noexcept
Gets the blue component of a color.
uint8_t red() const noexcept
Gets the red component of a color.
uint8_t green() const noexcept
Gets the green component of a color.
Color fade_out(double unit_amount) const noexcept
Decreases opacity of the color.
Color desaturate(double unit_amount) const noexcept
Produces a weaker tone by desaturating the color.
static Color from_rgba(double red, double green, double blue, double alpha=1.0) noexcept
Constructs a color with the given components.
static Color medium_cyan() noexcept
Solid cyan.
double saturation
The fullness of the color, from 0.0 (grey) to 1.0 (fully saturated).
A Sprite that displays text.
static constexpr Color white() noexcept
Solid white.
static Color medium_yellow() noexcept
Solid yellow.
static Color medium_blue() noexcept
Solid blue.
static constexpr Color black() noexcept
Solid black.
static Color medium_green() noexcept
Solid green.
double hue
The hue in degrees from 0 to 360.
double alpha
The opacity of the color, from 0.0 (fully transparent) to 1.0 (fully opaque).
static Color from_hsla(double hue, double saturation, double lightness, double alpha=1) noexcept
Constructs a color given the hue, saturation, lightness, and alpha.
constexpr Color() noexcept
Constructs the transparent color.
Color lighten(double unit_amount) const noexcept
Produces a tint by lightening the color.
double alpha
The opacity of the color, from 0.0 (fully transparent) to 1.0 (fully opaque).