Celeritas
0.5.0-86+4a8eea4
|
Stora an RGBA color. More...
#include <Color.hh>
Public Types | |
enum class | Channel { alpha , blue , green , red , size_ } |
Little-endian indexing for RGBA. | |
Type aliases | |
using | byte_type = std::uint8_t |
using | size_type = std::uint32_t |
using | Byte4 = Array< byte_type, 4 > |
Public Member Functions | |
CELER_CONSTEXPR_FUNCTION | Color (size_type c) |
Construct from an integer representation. | |
CELER_CONSTEXPR_FUNCTION | operator size_type () const |
Get an integer representation of the color. | |
std::string | to_html () const |
Get representation as an HTML color (#RRGGBB ). More... | |
CELER_FUNCTION byte_type | channel (Channel c) const |
Get a single channel. | |
Static Public Member Functions | |
static Color | from_html (std::string_view rgb) |
Construct with an #0178ef RGB or RGBA string (100% opaque). | |
static Color | from_rgb (size_type rgb) |
Construct from an RGB hex value (100% opaque). | |
static Color | from_rgba (size_type rgba) |
Construct from an RGBA value. | |
Stora an RGBA color.
This is used to define volume/material colors used for raytrace rendering. The "byte" is the bit depth of a channel.
std::string celeritas::Color::to_html | ( | ) | const |
Get representation as an HTML color (#RRGGBB
).
This drops the opacity