Namespace color::compare

TOC

Description

Contain functions to compare color by some criteria.

List

Name
equal
Declaration
template < typename category_name >
  bool equal( color::_internal::model< category_name > const& left, color::_internal::model< category_name > const& right );
Description
Compare tow color using equality test.
Example
::color::rgb<double> a{ ::color::constant::orange{} };
::color::rgb<double> b{ ::color::constant::lime{} };
std::cout<< ::color::compare::equal( a, b ) << std::endl;

Name
different
Declaration
template < typename category_name >
  bool different( color::_internal::model< category_name > const& left, color::_internal::model< category_name > const& right );
Description
Compare tow color using different test. If at least one componetn is different tha other function will return true.
Example
::color::rgb<double> a{ ::color::constant::orange{} };
::color::rgb<double> b{ ::color::constant::lime{} };
std::cout<< ::color::compare::different( a, b ) << std::endl;

Name
less_strict
Declaration
template < typename category_name >
  bool less_strict( color::_internal::model< category_name > const& left, color::_internal::model< category_name > const& right );
Description
Lexicografical compare by components if left side is strictly less that right.
Example
::color::rgb<double> a{ ::color::constant::orange{} };
::color::rgb<double> b{ ::color::constant::lime{} };
std::cout<< ::color::compare::less_strict( a, b ) << std::endl;

Name
great_strict
Declaration
template < typename category_name >
  bool great_strict( color::_internal::model< category_name > const& left, color::_internal::model< category_name > const& right );
Description
Lexicografical compare by components if left side is strictly great that right.
Example
::color::rgb<double> a{ ::color::constant::orange{} };
::color::rgb<double> b{ ::color::constant::lime{} };
std::cout<< ::color::compare::great_strict( a, b ) << std::endl;

Name
less_or_equal
Declaration
template < typename category_name >
  bool less_or_equal( color::_internal::model< category_name > const& left, color::_internal::model< category_name > const& right );
Description
Lexicografical compare by components if left side is less or equal that right.
Example
::color::rgb<double> a{ ::color::constant::orange{} };
::color::rgb<double> b{ ::color::constant::lime{} };
std::cout<< ::color::compare::less_or_equal( a, b ) << std::endl;

Name
great_or_equal
Declaration
template < typename category_name >
  bool great_or_equal( color::_internal::model< category_name > const& left, color::_internal::model< category_name > const& right );
Description
Lexicografical compare by components if left side is great or equal that right.
Example
::color::rgb<double> a{ ::color::constant::orange{} };
::color::rgb<double> b{ ::color::constant::lime{} };
std::cout<< ::color::compare::great_or_equal( a, b ) << std::endl;

Name
darker
Declaration
template < typename category_name >
  bool darker( color::_internal::model< category_name > const& left, color::_internal::model< category_name > const& right );
Description
Equvalent with
typedef typename ::color::trait::scalar< category_name > ::instance_type scalar_type;
::color::gray< scalar_type > ( left ) < ::color::gray< scalar_type >( right );
Example
::color::rgb<double> a{ ::color::constant::orange{} };
::color::rgb<double> b{ ::color::constant::lime{} };
std::cout<< ::color::compare::darker( a, b ) << std::endl;

Name
brighter
Declaration
template < typename category_name >
  bool brighter( color::_internal::model< category_name > const& left, color::_internal::model< category_name > const& right );
Description
Equvalent with:
typedef typename ::color::trait::scalar< category_name > ::instance_type scalar_type;
::color::gray< scalar_type > ( left ) > ::color::gray< scalar_type >( right );
Example
::color::rgb<double> a{ ::color::constant::orange{} };
::color::rgb<double> b{ ::color::constant::lime{} };
std::cout<< ::color::compare::brighter( a, b ) << std::endl;