doodle
0.2
Intended to support teaching C++, doodle is a simple library that helps make a window and makes it easy to do some drawing.
|
This is a helper class to easily represent an RGBA color as an int with hexadecimal notation. More...
#include <doodle/color.hpp>
Public Member Functions | |
constexpr | HexColor () noexcept=default |
The default color is black with full opacity. More... | |
constexpr | HexColor (unsigned hex) noexcept |
Implicitly convert from an unsigned int into a Hex Color. More... | |
constexpr | HexColor (int hex) noexcept |
Implicitly convert from an int into a Hex Color. More... | |
constexpr | operator Color () const noexcept |
Implicitly convert from a HexColor to a Color. More... | |
Public Attributes | |
unsigned | rgba = 0x000000ff |
This is a helper class to easily represent an RGBA color as an int with hexadecimal notation.
|
constexprdefaultnoexcept |
The default color is black with full opacity.
|
inlineconstexprnoexcept |
Implicitly convert from an unsigned int into a Hex Color.
hex | unsigned number to read as RGBA |
Definition at line 210 of file color.hpp.
|
inlineconstexprnoexcept |
Implicitly convert from an int into a Hex Color.
hex | int number to read as RGBA |
Definition at line 237 of file color.hpp.
|
inlineconstexprnoexcept |
Implicitly convert from a HexColor to a Color.
This is really the reason why this class exists. This allows us to implicitly specify an RGBA color with a single int and store it as a Color.