.. oe:namespace:: OEDepict

.. meta::
   :keywords: OEHighlightByColor, HighlightByColor


.. _OEDepict_OEHighlightByColor:

.. oe:class:: OEHighlightByColor

   .. oe:api::

      class OEHighlightByColor : public OEHighlightBase

   The :ref:`OEHighlightByColor <OEDepict_OEHighlightByColor>` class allows the
   customization of the **color** highlighting style that is
   associated with the :oe:const:`OEDepict::OEHighlightStyle::Color`
   constant.
   See example in :ref:`Figure: Example of highlighting using the
   'color' style<figure_OEHighlightStyle_Color>`.

   .. _figure_OEHighlightStyle_Color:

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

      **Example of highlighting using the 'color' style**


   The :ref:`OEHighlightByColor <OEDepict_OEHighlightByColor>` class stores the following properties:

   .. list-table::
      :widths: 100 100 100 150
      :header-rows: 1

      * - Property
        - Get method
        - Set method
        - Corresponding namespace / class / type

      * - external highlight
        - :oe:meth:`GetAtomExternalHighlight<OEDepict::OEHighlightByColor::GetAtomExternalHighlight>`
        - :oe:meth:`SetAtomExternalHighlight<OEDepict::OEHighlightByColor::SetAtomExternalHighlight>`
        - boolean

      * - color
        - :oe:meth:`GetColor<OEDepict::OEHighlightByColor::GetColor>`
        - :oe:meth:`SetColor<OEDepict::OEHighlightByColor::SetColor>`
        - :ref:`OEColor <OESystem_OEColor>`

      * - line width scale
        - :oe:meth:`GetLineWidthScale<OEDepict::OEHighlightByColor::GetLineWidthScale>`
        - :oe:meth:`SetLineWidthScale<OEDepict::OEHighlightByColor::SetLineWidthScale>`
        - floating point

   .. seealso::

      * :oe:func:`OEDepict::OEAddHighlighting` function
      * :oe:constns:`OEDepict::OEHighlightStyle` namespace
      * :ref:`OEHighlightByBallAndStick <OEDepict_OEHighlightByBallAndStick>` class
      * :ref:`OEHighlightByCogwheel <OEDepict_OEHighlightByCogwheel>` class
      * :ref:`OEHighlightByLasso <OEDepict_OEHighlightByLasso>` class
      * :ref:`OEHighlightByStick <OEDepict_OEHighlightByStick>` class
      * :ref:`chapter_highlighting` chapter


   .. ################################################################
      # Constructors
      ################################################################

   .. oe:method:: Constructors

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

         .. oe:api::

            OEHighlightByColor(const OESystem::OEColor& color,
                               double lineWidthScale = 1.5,
                               bool atomExternalHighlight = false)

      .. oe:language:: python

         .. oe:api:: python

            OEHighlightByColor(color: OEColor, lineWidthScale: float = 1.5,
                               atomExternalHighlight: bool = False) -> OEHighlightByColor

      Creates an :ref:`OEHighlightByColor <OEDepict_OEHighlightByColor>` object with the
      specified parameters.

      *color*
         The color used for highlighting.
         See also :oe:meth:`OEDepict::OEHighlightByColor::SetColor` method.

      *lineWidthScale*
         The multiplier that can be used to increase or decrease
         the line width of highlighted bond(s).
         See also :oe:meth:`OEDepict::OEHighlightByColor::SetLineWidthScale` method.

      *atomExternalHighlight*
         Sets whether atom highlights are extended to bonds not being
         highlighted.
         See also :oe:meth:`OEDepict::OEHighlightByColor::SetAtomExternalHighlight` method.

      .. ################################################################

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

         .. oe:api::

            OEHighlightByColor(const OEHighlightByColor& rhs)

      .. oe:language:: python

         .. oe:api:: python

            OEHighlightByColor(rhs: OEHighlightByColor) -> OEHighlightByColor

      Copy constructor.


   .. ################################################################
      # operator=
      ################################################################

   .. oe:method:: operator=
      :language: c++

      .. oe:api::

         OEHighlightByColor &operator=(const OEHighlightByColor &rhs)

      Assignment operator.


   .. oe:method:: CreateCopy

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

         .. oe:api::

            OEHighlightBase* CreateCopy() const

      .. oe:language:: python

         .. oe:api:: python

            CreateCopy() -> OEHighlightByColor

      Deep copy constructor that returns a copy of the object.
      The memory for the returned :ref:`OEHighlightByColor <OEDepict_OEHighlightByColor>`
      object is dynamically allocated and owned by the caller.


   .. oe:method:: GetAtomExternalHighlight

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

         .. oe:api::

            bool GetAtomExternalHighlight() const

      .. oe:language:: python

         .. oe:api:: python

            GetAtomExternalHighlight() -> bool

      Returns whether external atom highlight is applied.

      .. seealso::

         * :oe:meth:`OEDepict::OEHighlightByColor::SetAtomExternalHighlight` method


   .. oe:method:: GetColor

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

         .. oe:api::

            const OESystem::OEColor& GetColor() const

      .. oe:language:: python

         .. oe:api:: python

            GetColor() -> OEColor

      Returns the color of the highlighting.

      .. seealso::

         * :oe:meth:`OEDepict::OEHighlightByColor::GetColor` method
         * :ref:`OEColor <OESystem_OEColor>` class


   .. oe:method:: GetLineWidthScale

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

         .. oe:api::

            double GetLineWidthScale() const

      .. oe:language:: python

         .. oe:api:: python

            GetLineWidthScale() -> float

      Returns the multiplier that can be used to increase or decrease
      the line width of highlighted bond(s).

      .. seealso::

         * :oe:meth:`OEDepict::OEHighlightByColor::SetLineWidthScale` method


   .. oe:method:: SetAtomExternalHighlight

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

         .. oe:api::

            void SetAtomExternalHighlight(bool set)

      .. oe:language:: python

         .. oe:api:: python

            SetAtomExternalHighlight(atomexternal: bool) -> None

      Sets whether atom highlights are extended to bonds not being
      highlighted.

      Example (:ref:`Figure: Example of using the SetAtomExternalHighlight method<figure_OEHighlightByColor_SetAtomExternalHighlight>`)

      .. oe:source:: HighlightByColor.cpp
         :language: c++
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYCOLOR-SETATOMEXTERNALHIGHLIGHT

      .. oe:source:: HighlightByColor.py
         :language: python
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYCOLOR-SETATOMEXTERNALHIGHLIGHT

      .. oe:source:: HighlightByColor.java
         :language: java
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYCOLOR-SETATOMEXTERNALHIGHLIGHT

      .. oe:source:: HighlightByColor.cs
         :language: csharp
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYCOLOR-SETATOMEXTERNALHIGHLIGHT

      .. _figure_OEHighlightByColor_SetAtomExternalHighlight:

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

         **Example of using the SetAtomExternalHighlight method**

      .. seealso::

         * :oe:meth:`OEDepict::OEHighlightByColor::GetAtomExternalHighlight` method

   .. oe:method:: SetColor

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

         .. oe:api::

            void SetColor(const OESystem::OEColor& color)

      .. oe:language:: python

         .. oe:api:: python

            SetColor(color: OEColor) -> None

      Sets the color of the highlighting.

      Example (:ref:`Figure: Example of using the SetColor method<figure_OEHighlightByColor_SetColor>`)

      .. oe:source:: HighlightByColor.py
         :language: python
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYCOLOR-SETCOLOR

      .. oe:source:: HighlightByColor.cpp
         :language: c++
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYCOLOR-SETCOLOR

      .. oe:source:: HighlightByColor.java
         :language: java
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYCOLOR-SETCOLOR

      .. oe:source:: HighlightByColor.cs
         :language: csharp
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYCOLOR-SETCOLOR

      .. _figure_OEHighlightByColor_SetColor:

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

         **Example of using the SetColor method**

      .. seealso::

         * :oe:meth:`OEDepict::OEHighlightByColor::GetColor` method
         * :ref:`OEColor <OESystem_OEColor>` class


   .. oe:method:: SetLineWidthScale

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

         .. oe:api::

            void SetLineWidthScale(double lineWidthScale)

      .. oe:language:: python

         .. oe:api:: python

            SetLineWidthScale(lineWidthScale: float) -> None

      Sets the multiplier that can be used to increase or decrease
      the line width of highlighted bond(s).


      Example (:ref:`Figure: Example of using the SetLineWidthScale method<figure_OEHighlightByColor_SetLineWidthScale>`)

      .. oe:source:: HighlightByColor.py
         :language: python
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYCOLOR-SETLINEWIDTHSCALE

      .. oe:source:: HighlightByColor.cpp
         :language: c++
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYCOLOR-SETLINEWIDTHSCALE

      .. oe:source:: HighlightByColor.java
         :language: java
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYCOLOR-SETLINEWIDTHSCALE

      .. oe:source:: HighlightByColor.cs
         :language: csharp
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYCOLOR-SETLINEWIDTHSCALE

      .. _figure_OEHighlightByColor_SetLineWidthScale:

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

         **Example of using the SetLineWidthScale method**


      .. seealso::

         * :oe:meth:`OEDepict::OEHighlightByColor::GetLineWidthScale` method
