Celeritas  0.5.0-56+6b053cd
Public Types | Public Member Functions | Static Public Member Functions | List of all members
celeritas::Color Class Reference

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.
 

Detailed Description

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.

Member Function Documentation

◆ to_html()

std::string celeritas::Color::to_html ( ) const

Get representation as an HTML color (#RRGGBB).

This drops the opacity


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