Magnum::Math::Literals::ColorLiterals namespace new in Git master

Math color literals.

See the Literals namespace and the Color3 and Color4 classes for more information.

Functions

template<char... chars>
auto operator""_rgb() -> Color3<UnsignedByte> constexpr
8bit-per-channel linear RGB literal
template<char... chars>
auto operator""_srgb() -> Vector3<UnsignedByte> constexpr
8bit-per-channel sRGB literal
template<char... chars>
auto operator""_rgba() -> Color4<UnsignedByte> constexpr
8bit-per-channel linear RGBA literal
template<char... chars>
auto operator""_srgba() -> Vector4<UnsignedByte> constexpr
8bit-per-channel sRGB + alpha literal
template<char... chars>
auto operator""_rgbf() -> Color3<Float> constexpr
Float linear RGB literal.
template<char... chars>
auto operator""_srgbf() -> Color3<Float>
Float sRGB literal.
template<char... chars>
auto operator""_rgbaf() -> Color4<Float> constexpr
Float linear RGBA literal.
template<char... chars>
auto operator""_srgbaf() -> Color4<Float>
Float sRGB + alpha literal.
template<char... chars>
auto operator""_rgbh() -> Color3<Half> new in Git master
Half-float linear RGB literal.
template<char... chars>
auto operator""_srgbh() -> Color3<Half> new in Git master
Half-float sRGB literal.
template<char... chars>
auto operator""_rgbah() -> Color4<Half> new in Git master
Half-float linear RGBA literal.
template<char... chars>
auto operator""_srgbah() -> Color4<Half> new in Git master
Half-float sRGB + alpha literal.

Function documentation

template<char... chars>
Color3<UnsignedByte> Magnum::Math::Literals::ColorLiterals::operator""_rgb() constexpr

8bit-per-channel linear RGB literal

Unpacks the literal into three 8-bit values. Example usage:

using namespace Math::Literals;
Color3ub a = 0x33b27f_rgb;      // {0x33, 0xb2, 0x7f}

template<char... chars>
Vector3<UnsignedByte> Magnum::Math::Literals::ColorLiterals::operator""_srgb() constexpr

8bit-per-channel sRGB literal

Unpacks the literal into three 8-bit values without any colorspace conversion. Behaves identically to operator""_rgb() though it doesn't return a Color3 type to indicate that the resulting value is not linear RGB. Use this literal to document that given value is in sRGB. Example usage:

using namespace Math::Literals;
Vector3ub a = 0x33b27f_srgb;    // {0x33, 0xb2, 0x7f}

template<char... chars>
Color4<UnsignedByte> Magnum::Math::Literals::ColorLiterals::operator""_rgba() constexpr

8bit-per-channel linear RGBA literal

Unpacks the literal into four 8-bit values. Example usage:

using namespace Math::Literals;
Color4ub a = 0x33b27fcc_rgba;   // {0x33, 0xb2, 0x7f, 0xcc}

template<char... chars>
Vector4<UnsignedByte> Magnum::Math::Literals::ColorLiterals::operator""_srgba() constexpr

8bit-per-channel sRGB + alpha literal

Unpacks the literal into four 8-bit values without any colorspace conversion. Behaves identically to operator""_rgba() though it doesn't return a Color4 type to indicate that the resulting value is not linear RGBA. Use this literal to document that given value is in sRGB + alpha. Example usage:

using namespace Math::Literals;
Vector4ub a = 0x33b27fcc_srgba; // {0x33, 0xb2, 0x7f, 0xcc}

template<char... chars>
Color3<Float> Magnum::Math::Literals::ColorLiterals::operator""_rgbf() constexpr

Float linear RGB literal.

Equivalent to calling Color3::fromLinearRgbInt() on the literal value. Example usage:

using namespace Math::Literals;
Color3 a = 0x33b27f_rgbf;       // {0.2f, 0.698039f, 0.498039f}

template<char... chars>
Color3<Float> Magnum::Math::Literals::ColorLiterals::operator""_srgbf()

Float sRGB literal.

Equivalent to calling Color3::fromSrgbInt() on the literal value. Example usage:

using namespace Math::Literals;
Color3 a = 0x33b27f_srgbf;      // {0.0331048f, 0.445201f, 0.212231f}

template<char... chars>
Color4<Float> Magnum::Math::Literals::ColorLiterals::operator""_rgbaf() constexpr

Float linear RGBA literal.

Equivalent to calling Color4::fromLinearRgbaInt() on the literal value. Example usage:

using namespace Math::Literals;
Color4 a = 0x33b27fcc_rgbaf;    // {0.2f, 0.698039f, 0.498039f, 0.8f}

template<char... chars>
Color4<Float> Magnum::Math::Literals::ColorLiterals::operator""_srgbaf()

Float sRGB + alpha literal.

Equivalent to calling Color4::fromSrgbAlphaInt() on the literal value. Example usage:

using namespace Math::Literals;
Color4 a = 0x33b27fcc_srgbaf;   // {0.0331048f, 0.445201f, 0.212231f, 0.8f}

template<char... chars>
Color3<Half> Magnum::Math::Literals::ColorLiterals::operator""_rgbh() new in Git master

Half-float linear RGB literal.

Equivalent to calling Color3::fromLinearRgbInt() on the literal value and then casting from a float to a half-float type. Example usage:

using namespace Math::Literals;
Color3h a = 0x33b27f_rgbh;      // {0.2_h, 0.6982_h, 0.498_h}

template<char... chars>
Color3<Half> Magnum::Math::Literals::ColorLiterals::operator""_srgbh() new in Git master

Half-float sRGB literal.

Equivalent to calling Color3::fromSrgbInt() on the literal value and then casting from a float to a half-float type. Example usage:

using namespace Math::Literals;
Color3h a = 0x33b27f_srgbh;     // {0.03311_h, 0.4453_h, 0.2123_h}

template<char... chars>
Color4<Half> Magnum::Math::Literals::ColorLiterals::operator""_rgbah() new in Git master

Half-float linear RGBA literal.

Equivalent to calling Color4::fromLinearRgbaInt() on the literal value and then casting from a float to a half-float type. Example usage:

using namespace Math::Literals;
Color4h a = 0x33b27fcc_rgbah;   // {0.2_h, 0.6982_h, 0.498_h, 0.7998_h}

template<char... chars>
Color4<Half> Magnum::Math::Literals::ColorLiterals::operator""_srgbah() new in Git master

Half-float sRGB + alpha literal.

Equivalent to calling Color4::fromSrgbAlphaInt() on the literal value and then casting from a float to a half-float type. Example usage:

using namespace Math::Literals;
Color4h a = 0x33b27fcc_srgbah;  // {0.03311_h, 0.4453_h, 0.2123_h, 0.7998_h}