.. # split from OESystemFunctions.rst:1047

.. include:: ../substitutions

.. oe:namespace:: OESystem

.. meta::
   :keywords: OEGetContrastColors

.. oe:function:: OEGetContrastColors

   .. oe:language:: c++ java csharp

      .. oe:api::

         OEIterBase<OEColor>* OEGetContrastColors(bool whiteblack = false)

   .. oe:language:: python

      .. oe:api:: python

         OEGetContrastColors(whiteblack: bool = False) -> Iterable[OEColor]

   Returns the iterator over colors of maximum contrast depicted in
   :ref:`Figure: Colors of maximum contrast<figure_OEGetContrastColors>`.

   *whiteblack*
      If true, then :oe:const:`OEWhite<OESystem::OESystem::OEWhite>` and
      :oe:const:`OEBlack<OESystem::OESystem::OEBlack>` are returned as the first
      and second color by the :oe:func:`OESystem::OEGetContrastColors` function.

   .. _figure_OEGetContrastColors:

   .. figure:: ../images/OEGetContrastColors.*
      :align:  center

      **Colors of maximum contrast**


   .. _figure_OEGetContrastColors_BW:

   .. figure:: ../images/OEGetContrastColors_BW.*
      :align:  center

      **Colors of maximum contrast with white and black**

   The 22 colors depicted in :ref:`Figure: Colors of maximum contrast with white
   and black<figure_OEGetContrastColors_BW>` are called Kelly's colors.
   The order of colors in Kelly's list is designed to maximize contrast between
   colors in a set.
   The first nine colors (white, black, yellow, purple, orange, light blue, red, buff, grey)
   are selected to be discriminating even for people with
   color vision deficiency.

   .. seealso::

      * [Kelly-1965]_
      * [Green-Armytage-2010]_

