1#ifndef LIBSBX_MATH_COLOR_HPP_
2#define LIBSBX_MATH_COLOR_HPP_
6#include <yaml-cpp/yaml.h>
20 color(std::uint32_t rgba)
noexcept;
22 color(std::float_t red, std::float_t green, std::float_t blue, std::float_t alpha = 1.0f)
noexcept;
24 static auto black()
noexcept ->
color {
25 return color{0.0f, 0.0f, 0.0f, 1.0f};
28 static auto white()
noexcept ->
color {
29 return color{1.0f, 1.0f, 1.0f, 1.0f};
32 static auto red()
noexcept ->
color {
33 return color{1.0f, 0.0f, 0.0f, 1.0f};
36 static auto green()
noexcept ->
color {
37 return color{0.0f, 1.0f, 0.0f, 1.0f};
40 static auto blue()
noexcept ->
color {
41 return color{0.0f, 0.0f, 1.0f, 1.0f};
44 static auto magenta()
noexcept ->
color {
45 return color{1.0f, 0.0f, 1.0f, 1.0f};
48 static auto yellow()
noexcept ->
color {
49 return color{1.0f, 1.0f, 0.0f, 1.0f};
52 static auto cyan()
noexcept ->
color {
53 return color{0.0f, 1.0f, 1.0f, 1.0f};
56 auto r()
const noexcept ->
const std::float_t&;
58 auto r()
noexcept -> std::float_t&;
60 auto g()
const noexcept ->
const std::float_t&;
62 auto g()
noexcept -> std::float_t&;
64 auto b()
const noexcept ->
const std::float_t&;
66 auto b()
noexcept -> std::float_t&;
68 auto a()
const noexcept ->
const std::float_t&;
70 auto a()
noexcept -> std::float_t&;
81auto operator==(
const color& lhs,
const color& rhs)
noexcept -> bool;
83auto operator*(
color lhs,
const std::float_t value) ->
color;
88struct YAML::convert<sbx::math::color> {
93auto operator<<(YAML::Emitter& out,
const sbx::math::color& color) -> YAML::Emitter&;
96struct std::hash<sbx::math::color> {
97 auto operator()(
const sbx::math::color& color)
const noexcept -> std::size_t;