82 constexpr
Color() noexcept = default;
111 explicit constexpr
Color(
double grey,
double alpha = 255) noexcept
112 : red(grey), green(grey), blue(grey), alpha(alpha)
147 constexpr
Color(
double red,
double green,
double blue,
double alpha = 255) noexcept
148 : red(red), green(green), blue(blue), alpha(alpha)
160 unsigned rgba = 0x000000ff;
210 constexpr
HexColor(
unsigned hex) noexcept : rgba(hex) {}
237 constexpr
HexColor(
int hex) noexcept : rgba(
static_cast<unsigned>(hex)) {}
268 constexpr
operator Color() const noexcept
270 return Color{
static_cast<double>((rgba & 0xff000000) >> 24),
271 static_cast<double>((rgba & 0x00ff0000) >> 16),
272 static_cast<double>((rgba & 0x0000ff00) >> 8),
273 static_cast<double>((rgba & 0x000000ff) >> 0)};
This is a helper class to easily represent an RGBA color as an int with hexadecimal notation.
constexpr HexColor(int hex) noexcept
Implicitly convert from an int into a Hex Color.
constexpr HexColor() noexcept=default
The default color is black with full opacity.
Color is a color represented with four unsigned bytes.
constexpr Color(double red, double green, double blue, double alpha=255) noexcept
When three values are specified, they are interpreted as RGB. Adding a fourth value applies alpha tra...
constexpr Color() noexcept=default
The default color is black with full opacity.