Struct ColorRGB

Inheritance Relationships

Base Type

Struct Documentation

struct ColorRGB : public TCOD_ColorRGB

A C++ RGB color, used to handle conversions between color types.

New in version 1.19.

Public Functions

inline constexpr ColorRGB() noexcept

Default construct a black ColorRGB object.

RGB values are zero.

inline constexpr ColorRGB(uint8_t red, uint8_t green, uint8_t blue) noexcept

Construct a ColorRGB object with the provided color.

inline explicit constexpr ColorRGB(const TCOD_ColorRGB &rhs) noexcept

Construct a ColorRGB object from an TCOD_ColorRGB struct.

inline explicit constexpr ColorRGB(const TCOD_ColorRGBA &rhs) noexcept

Construct a ColorRGB object from an RGBA color, truncating the alpha.

inline constexpr operator const TCOD_ColorRGBA() const noexcept

Allow implicit casts to RGBA colors, where alpha=255 is implied.

inline explicit constexpr operator TCOD_ColorRGB*() noexcept

Allow explicit casts to a TCOD_ColorRGB pointer.

inline explicit constexpr operator const TCOD_ColorRGB*() const noexcept

Allow explicit casts to a const TCOD_ColorRGB pointer.