nCine::Colorf class

Four-channels normalized color with float per component.

Public static variables

static std::int32_t NumChannels constexpr
static const Colorf Black
static const Colorf White
static const Colorf Red
static const Colorf Green
static const Colorf Blue
static const Colorf Yellow
static const Colorf Magenta
static const Colorf Cyan

Constructors, destructors, conversion operators

Colorf() constexpr noexcept
Default constructor (transparent color)
Colorf(NoInitT) explicit noexcept
Colorf(float red, float green, float blue) constexpr noexcept
Three channels constructor.
Colorf(float red, float green, float blue, float alpha) constexpr noexcept
Four channels constructor.
Colorf(const float channels[NumChannels]) explicit noexcept
Four channels constructor from an array.
Colorf(const Color& color) explicit noexcept

Public functions

auto Data() const -> const float*
Returns color array.
auto Data() -> float*
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void Set(float red, float green, float blue, float alpha) constexpr
Sets four color channels.
void Set(float red, float green, float blue)
Sets three color channels.
void SetVec(const float channels[NumChannels])
Sets four color channels from an array.
void SetAlpha(float alpha)
Sets the alpha channel.
auto operator=(const Color& color) -> Colorf&
Assigns operator from an unsigned char color.
auto operator==(const Colorf& color) const -> bool
auto operator!=(const Colorf& color) const -> bool
auto operator+=(const Colorf& v) -> Colorf&
auto operator-=(const Colorf& v) -> Colorf&
auto operator*=(const Colorf& color) -> Colorf&
auto operator*=(float scalar) -> Colorf&
Multiplies by a constant scalar.
auto operator+(const Colorf& color) const -> Colorf
auto operator-(const Colorf& color) const -> Colorf
auto operator*(const Colorf& color) const -> Colorf
auto operator*(float scalar) const -> Colorf
Multiplies by a constant scalar.

Public variables

float R
float G
float B
float A