class
#include <nCine/Primitives/Colorf.h>
Colorf Four-channels normalized color with float per component.
Public static variables
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.