Operators

TOC

Description

Most easiest way to manipulate with color.

Note

For efficiently reason it is only possible to have operation only with same categeory.
To perform operation between different categories convert one side to appropriate one.

Operators

+
Name
+
Declaration
template< typename category_name>
::color::model<category_name> operator +( ::color::model<category_name> const&left, ::color::model<category_name> const& right );
Description
Add two colors.
Mostly addition will be performed like we add two vectors by adding component by coordinates.
Note
Over burn will not be controlled.
Integrity will be respected.
Example:
::color::rgba<double> a{ ::color::constant::orange{} };
::color::rgba<double> b{ ::color::constant::turquoise{} };
::color::rgba<double> c;
a = b + c;

+=
Name
+=
Declaration
template< typename category_name>
::color::model<category_name> & operator +=( ::color::model<category_name> & result, ::color::model<category_name> const& right );
Description
Accumulated version of addition of two colors.
Mostly addition will be performed like we add two vectors by adding component by coordinates.
Note
Over burn will not be controlled.
Integrity will be respected.
Example:
::color::rgba<double> a{ ::color::constant::orange{} };
::color::rgba<double> b{ ::color::constant::turquoise{} };
a += b;

-
Name
-
Declaration
template< typename category_name>
::color::model<category_name> operator -( ::color::model<category_name> const& left, ::color::model<category_name> const& right );
Description
Subtract two colors.
Mostly subtraction will be performed like we subtract two vectors by coordinates.
Note
Over burn will not be controlled.
Integrity will be respected.
Example:
::color::rgba<double> a{ ::color::constant::orange{} };
::color::rgba<double> b{ ::color::constant::turquoise{} };
::color::rgba<double> c;
a = b - c;

-=
Name
-=
Declaration
template< typename category_name>
::color::model<category_name> & operator -=( ::color::model<category_name> & result, ::color::model<category_name> const& right );
Description
Accumulated version of subtraction of two colors.
Mostly addition will be performed like we subtract two vectors by coordinates.
Note
Over burn will not be controlled.
Integrity will be respected.
Example:
::color::rgba<double> a{ ::color::constant::orange{} };
::color::rgba<double> b{ ::color::constant::turquoise{} };
a -= b;

*
Name
*
Declaration
template< typename category_name, typename scalar_name >
::color::model<category_name> operator *( scalar_name const& left, ::color::model<category_name> const& right );
Description
Multiply color by scalar from left side
Note
Over burn will not be controlled.
Integrity will be respected.
Example:
::color::rgba<double> a;
::color::rgba<double> b{ ::color::constant::turquoise{} };
a = 0.1 * b;

*
Name
*
Declaration
template< typename category_name, typename scalar_name >
::color::model<category_name> operator *( ::color::model<category_name> const& left, scalar_name const & right );
Description
Multiply color by scalar from right side.
Note
Over burn will not be controlled.
Integrity will be respected.
Example:
::color::rgba<double> a;
::color::rgba<double> b{ ::color::constant::turquoise{} };
a = b * 0.3;

*=
Name
*=
Declaration
template< typename category_name, typename scalar_name >
::color::model<category_name> & operator *=(::color::model<category_name> & result, scalar_name const& scalar );
Note
Over burn will not be controlled.
Integrity will be respected.
Description
Accumulated version of multiplying color with scalar.
Example:
::color::rgba<double> a{ ::color::constant::turquoise{} };
a *= 0.3;

/
Name
/
Declaration
template< typename category_name, typename scalar_name >
::color::model<category_name> operator /( ::color::model<category_name> const& left, scalar_name const& right );
Description
Divide color by scalar. Equivalent with multiplication color by inverse value of scalar.
Note
Over burn will not be controlled.
Integrity will be respected.
Example:
::color::rgba<double> a{ ::color::constant::orange{} };
::color::rgba<double> b{ ::color::constant::turquoise{} };
a = b / 0.3;

/=
Name
/=
Declaration
template< typename category_name, typename scalar_name >
::color::model<category_name> & operator /=(::color::model<category_name> & result, scalar_name const& scalar );
Description
Accumulate version of division by scalar.
Note
Over burn will not be controlled.
Integrity will be respected.
Example:
::color::rgba<double> a{ ::color::constant::orange{} };
a /= 0.3;

==
Name
==
Declaration
template< typename category_name, typename scalar_name >
bool operator ==( ::color::model<category_name> const& left, ::color::model<category_name> const& right );
Description
Compare two colors component by component.
Note
Both instances must be same model and format.
If they are different conversion will be involved and performance will be compromised.
To compare two instance of different model/format use explicit conversion.
Example:
::color::rgb<double> a{ ::color::constant::orange{} };
::color::rgb<double> b{ ::color::constant::lime{} };
std::cout<< a == b << std::endl;

!=
Name
!=
Declaration
template< typename category_name, typename scalar_name >
bool operator !=( ::color::model<category_name> const& left, ::color::model<category_name> const& right );
Description
Compare two colors component by component.
Note
Both instances must be same model and format.
If they are different conversion will be involved and performance will be compromised.
To compare two instance of different model/format use explicit conversion.
Example:
::color::rgb<double> a{ ::color::constant::orange{} };
::color::rgb<double> b{ ::color::constant::lime{} };
std::cout<< a != b << std::endl;

<
Name
<
Declaration
template< typename category_name, typename scalar_name >
bool operator < ( ::color::model<category_name> const& left, ::color::model<category_name> const& right );
Description
Compare two colors component by component.
Note
Both instances must be same model and format.
If they are different conversion will be involved and performance will be compromised.
To compare two instance of different model/format use explicit conversion.
Example:
::color::rgb<double> a{ ::color::constant::orange{} };
::color::rgb<double> b{ ::color::constant::lime{} };
std::cout<< a < b << std::endl;

>
Name
>
Declaration
template< typename category_name, typename scalar_name >
bool operator >( ::color::model<category_name> const& left, ::color::model<category_name> const& right );
Description
Compare two colors component by component.
Note
Both instances must be same model and format.
If they are different conversion will be involved and performance will be compromised.
To compare two instance of different model/format use explicit conversion.
Example:
::color::rgb<double> a{ ::color::constant::orange{} };
::color::rgb<double> b{ ::color::constant::lime{} };
std::cout<< a > b << std::endl;

<=
Name
<=
Declaration
template< typename category_name, typename scalar_name >
bool operator <=( ::color::model<category_name> const& left, ::color::model<category_name> const& right );
Description
Compare two colors component by component.
Note
Both instances must be same model and format.
If they are different conversion will be involved and performance will be compromised.
To compare two instance of different model/format use explicit conversion.
Example:
::color::rgb<double> a{ ::color::constant::orange{} };
::color::rgb<double> b{ ::color::constant::lime{} };
std::cout<< a <= b << std::endl;

>=
Name
>=
Declaration
template< typename category_name, typename scalar_name >
bool operator >=( ::color::model<category_name> const& left, ::color::model<category_name> const& right );
Description
Compare two colors component by component.
Note
Both instances must be same model and format.
If they are different conversion will be involved and performance will be compromised.
To compare two instance of different model/format use explicit conversion.
Example:
::color::rgb<double> a{ ::color::constant::orange{} };
::color::rgb<double> b{ ::color::constant::lime{} };
std::cout<< a >= b << std::endl;