21template <std::
floating_po
int T>
28template <std::
integral T>
58 const T
mn = std::numeric_limits<T>::min();
65 const T
mx = std::numeric_limits<T>::max();
118 constexpr operator std::tuple<T, T, T>()
const {
return std::make_tuple(
_red,
_green,
_blue ); }
174 return std::min( std::min(
input.red(),
input.green() ),
input.blue() );
180 return std::max( std::max(
input.red(),
input.green() ),
input.blue() );
183 template <std::
floating_po
int OT>
201template <std::
floating_po
int T>
242 template<std::
integral OtherT>
249 const T
Max{ std::numeric_limits<OtherT>::max() };
266 if (
this == &
other )
353 constexpr operator std::tuple<value_type, value_type, value_type>()
const {
return std::make_tuple(
_red,
_green,
_blue ); }
435 return std::fmin( std::fmin(
input.red(),
input.green() ),
input.blue() );
440 return std::fmax( std::fmax(
input.red(),
input.green() ),
input.blue() );
453template <std::
floating_po
int T>
456 struct not_checked { };
497 operator T()
const {
return _value.value(); }
773template <std::
floating_po
int T>
819 if (
this == &
other )
982template <std::
floating_po
int T>
1028 if (
this == &
other )
constexpr value_type saturation() const
constexpr value_type lightness() const
static constexpr BasicHSV< T > max()
constexpr BasicHSL & operator=(const BasicHSL &other)
constexpr Math::BasicDegree< value_type > hue() const
constexpr BasicHSL()=default
constexpr bool _isInBoundsUpTo(value_type component, value_type lower_bound=0.0, value_type upper_bound=1.0) const
constexpr bool isInf() const
constexpr enum Color hueColor() const
constexpr void saturation(value_type input)
constexpr BasicHSL(Math::BasicDegree< value_type > h, value_type s, value_type l)
constexpr void hue(Math::BasicDegree< value_type > input)
constexpr bool _isInBounds(value_type component, value_type lower_bound=0.0, value_type upper_bound=1.0) const
static constexpr BasicHSL< T > min()
constexpr bool isNormalized() const
Math::BasicDegree< value_type > _hue
constexpr void lightness(value_type input)
constexpr BasicHSL(const BasicHSL &other)
constexpr bool isNaN() const
T value_type
The type of the underlying implementation for each color.
constexpr value_type saturation() const
constexpr BasicHSV(const BasicHSV &other)
static constexpr BasicHSV< T > max()
constexpr Math::BasicDegree< value_type > hue() const
constexpr BasicHSV(Math::BasicDegree< value_type > h, value_type s, value_type v)
constexpr bool _isInBoundsUpTo(value_type component, value_type lower_bound=0.0, value_type upper_bound=1.0) const
constexpr bool isInf() const
constexpr void value(value_type input)
constexpr enum Color hueColor() const
constexpr void saturation(value_type input)
constexpr value_type value() const
constexpr void hue(Math::BasicDegree< value_type > input)
constexpr bool _isInBounds(value_type component, value_type lower_bound=0.0, value_type upper_bound=1.0) const
static constexpr BasicHSV< T > min()
constexpr BasicHSV & operator=(const BasicHSV &other)
constexpr bool isNormalized() const
Math::BasicDegree< value_type > _hue
constexpr BasicHSV()=default
constexpr bool isNaN() const
T value_type
The type of the underlying implementation for each color.
constexpr BasicHue(T init_value)
constexpr BasicHue< T > & operator-=(BasicHue< T > other)
friend constexpr BasicHue< T > operator-(const BasicHue< T > &left, const BasicHue< T > &right)
friend constexpr bool operator==(const BasicHue< T > &left, const BasicHue< T > &right)=default
static constexpr BasicHue< T > min()
constexpr BasicHue< T > & operator+=(BasicHue< T > other)
constexpr bool isInf() const
static constexpr BasicHue< T > max()
constexpr BasicHue< T > modulo() const
static constexpr BasicHue< T > zero()
friend constexpr BasicHue< T > operator*(const BasicHue< T > &left, const BasicHue< T > &right)
friend constexpr auto operator<=>(const BasicHue< T > &left, const BasicHue< T > &right)=default
constexpr BasicHue< T > & operator*=(BasicHue< T > other)
Math::BasicDegree< T > _value
constexpr BasicHue(Math::BasicDegree< T > init_value)
friend constexpr BasicHue< T > operator/(const BasicHue< T > &left, const BasicHue< T > &right)
constexpr BasicHue< T > & operator/=(BasicHue< T > other)
constexpr BasicHue()=default
constexpr bool isNaN() const
T value_type
The type of the underlying implementation for each color.
friend constexpr BasicHue< T > operator+(const BasicHue< T > &left, const BasicHue< T > &right)
constexpr void r(value_type input)
constexpr BasicRGB(value_type r, value_type g, value_type b)
static constexpr BasicRGB< T > zero()
static constexpr BasicRGB< T > min()
constexpr void blue(value_type input)
constexpr value_type red() const
friend BasicUnitRGB< OT > normalized(const BasicRGB< T > &input)
constexpr value_type blue() const
static constexpr BasicRGB< T > max()
constexpr value_type g() const
constexpr BasicRGB(const std::tuple< T, T, T > &init_value)
friend constexpr T min(const BasicRGB< T > &input)
constexpr void green(value_type input)
constexpr BasicRGB()=default
Defaults to (0, 0, 0)
constexpr value_type b() const
constexpr value_type r() const
constexpr value_type green() const
constexpr void g(value_type input)
friend constexpr bool operator==(const BasicRGB< T > &left, const BasicRGB< T > &right)=default
friend constexpr T max(const BasicRGB< T > &input)
constexpr void red(value_type input)
constexpr void b(value_type input)
T value_type
The type of the underlying implementation for each color.
constexpr void r(value_type input)
constexpr void blue(value_type input)
constexpr value_type red() const
constexpr BasicUnitRGB(const std::tuple< value_type, value_type, value_type > &init_value)
static constexpr BasicUnitRGB< T > max()
constexpr BasicUnitRGB< T > & operator=(const BasicUnitRGB< T > &other)
constexpr bool isInf() const
constexpr value_type blue() const
constexpr BasicUnitRGB(value_type r, value_type g, value_type b)
constexpr value_type g() const
constexpr BasicUnitRGB(const BasicUnitRGB< T > &other)
static constexpr BasicUnitRGB< T > min()
constexpr void green(value_type input)
constexpr value_type b() const
constexpr value_type r() const
constexpr value_type green() const
constexpr BasicUnitRGB(const BasicRGB< OtherT > &other)
constexpr void g(value_type input)
friend constexpr T max(const BasicUnitRGB< T > &input)
constexpr bool _isInBounds(value_type component) const
constexpr bool isNormalized() const
constexpr BasicUnitRGB()=default
static constexpr BasicUnitRGB< T > zero()
constexpr void red(value_type input)
constexpr bool isNaN() const
friend constexpr T min(const BasicUnitRGB< T > &input)
constexpr void b(value_type input)
T value_type
The type of the underlying implementation for each color.
static constexpr T modulus()
constexpr BasicDegree< T > modulo() const
friend constexpr BasicHSL< T > operator-(const BasicHSL< T > &left, const BasicHSL< T > &right)
friend constexpr BasicHSL< T > operator+(const BasicHSL< T > &left, const BasicHSL< T > &right)
friend constexpr BasicHSV< T > operator-(const BasicHSV< T > &left, const BasicHSV< T > &right)
friend constexpr BasicHSV< T > operator+(const BasicHSV< T > &left, const BasicHSV< T > &right)
friend constexpr BasicRGB< T > operator+(const BasicRGB< T > &left, const BasicRGB< T > &right)
friend constexpr BasicRGB< T > operator-(const BasicRGB< T > &left, const BasicRGB< T > &right)
friend constexpr BasicRGB< T > operator*(const BasicRGB< T > &left, const BasicRGB< T > &right)
friend constexpr BasicUnitRGB< T > operator+(const BasicUnitRGB< T > &left, const BasicUnitRGB< T > &right)
friend constexpr BasicUnitRGB< T > operator*(const BasicUnitRGB< T > &left, const BasicUnitRGB< T > &right)
friend constexpr BasicUnitRGB< T > operator-(const BasicUnitRGB< T > &left, const BasicUnitRGB< T > &right)
friend constexpr bool approximately_equal_to(const BasicHSV< T > &value_to_test, const BasicHSV< T > &value_it_should_be, T tolerance=T{0.0002})
friend constexpr bool approximately_equal_to(const BasicHSL< T > &value_to_test, const BasicHSL< T > &value_it_should_be, T tolerance=T{0.0002})
friend constexpr bool approximately_equal_to(const BasicUnitRGB< T > &value_to_test, const BasicUnitRGB< T > &value_it_should_be, T tolerance=T{0.0002})
friend constexpr bool approximately_equal_to(const BasicHue< T > &value_to_test, const BasicHue< T > &value_it_should_be, T tolerance=T{0.0002})
constexpr const Type & saturate(const Type &value, const Type &lower_bound, const Type &upper_bound)