.. include:: ../substitutions

.. oe:namespace:: OEDepict

.. meta::
   :keywords: OEConfigureColor

.. _OEDepict_OEConfigureColor:


.. oe:function:: OEConfigureColor


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

      .. oe:api::

         bool OEConfigureColor(OESystem::OEInterface& itf,
                               const std::string& name,
                               const std::string& alias,
                               const std::string& brief,
                               std::string defcolor = "red")

   .. oe:language:: python

      .. oe:api:: python

         OEConfigureColor(itf: OEInterface, name: str, alias: str, brief: str,
                          defcolor: str = "red") -> bool

   Adds a *color* parameter to the given interface.

   *itf*
      The interface being configured.

   *name*
      The name of the color parameter.

   *alias*
      The alternative *i.e.* alias name of the parameter.

   *brief*
      The brief description of the parameter.

   *defcolor*
      The default color of the parameter.

   **Example:**

   .. oe:source:: OEConfigureColor.py
      :language: python
      :noindent:
      :frag:     SNIPPET-OECONFIGURECOLOR

   .. oe:source:: OEConfigureColor.cpp
      :language: c++
      :noindent:
      :frag:     SNIPPET-OECONFIGURECOLOR

   .. oe:source:: OEConfigureColor.java
      :language: java
      :noindent:
      :frag:     SNIPPET-OECONFIGURECOLOR

   .. oe:source:: OEConfigureColor.cs
      :language: csharp
      :noindent:
      :frag:     SNIPPET-OECONFIGURECOLOR

   The above snippet will generate the following  parameter:

   .. code-block:: console

      Contents of parameter mycolor
          Aliases : c
          Type : string
          Allow list : false
          Default : blue
          Simple : true
          Required : false
          Legal values : black blue bluetint brass brown copper cyan darkblue
             darkbrown darkcyan darkgreen darkgrey darkmagenta darkorange
             darkpurple darkred darkrose darksalmon darkyellow gold green
             greenblue greentint grey hotpink lightblue lightbrown lightgreen
             lightgrey lightorange lightpurple lightsalmon limegreen magenta
             mediumblue mediumbrown mediumgreen mediumorange mediumpurple
             mediumsalmon mediumyellow olivebrown olivegreen olivegrey pewter
             orange pink pinktint purple red redorange royalblue seagreen silver
             skyblue violet white yellow yellowtint
          Brief : Example of using OEConfigureColor

   .. seealso::

      * :ref:`OEInterface <OESystem_OEInterface>` class in the **OEChem TK** manual
      * :oe:func:`OEDepict::OEGetColor` function
      * :ref:`OEColor <OESystem_OEColor>` class
