Donner
C++20 SVG rendering library
Loading...
Searching...
No Matches
donner::css::HSLA Struct Reference

Represents an HSLA color. More...

#include "donner/css/Color.h"

Public Member Functions

constexpr HSLA (float hDeg, float s, float l, uint8_t a)
 Constructor, initializes to the given HSLA values.
 
RGBA toRGBA () const
 Convert the color to an RGBA color.
 
bool operator== (const HSLA &) const =default
 Equality operator.
 

Static Public Member Functions

static constexpr HSLA HSL (float hDeg, float s, float l)
 Constructor, for HSL colors, which are fully opaque.
 

Public Attributes

float hDeg
 Hue component, in degrees [0, 360].
 
float s
 Saturation component, as a percentage [0, 1].
 
float l
 Lightness component, as a percentage [0, 1].
 
uint8_t a = 0xFF
 Alpha component, as uint8 [0, 255].
 

Friends

std::ostream & operator<< (std::ostream &os, const HSLA &color)
 Ostream output operator.
 

Detailed Description

Represents an HSLA color.

Constructor & Destructor Documentation

◆ HSLA()

constexpr donner::css::HSLA::HSLA ( float hDeg,
float s,
float l,
uint8_t a )
inlineconstexpr

Constructor, initializes to the given HSLA values.

Parameters
hDegThe hue component, in degrees [0, 360].
sThe saturation component, as a percentage [0, 1].
lThe lightness component, as a percentage [0, 1].
aThe alpha component, as a uint8 [0, 255].

Member Function Documentation

◆ HSL()

static constexpr HSLA donner::css::HSLA::HSL ( float hDeg,
float s,
float l )
inlinestaticconstexpr

Constructor, for HSL colors, which are fully opaque.

Parameters
hDegThe hue component, in degrees [0, 360].
sThe saturation component, as a percentage [0, 1].
lThe lightness component, as a percentage [0, 1].

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
const HSLA & color )
friend

Ostream output operator.

Outputs: hsla(h, s, l, a).

Parameters
osThe output stream.
colorThe color to output.

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