.. oe:namespace:: OEShape

.. meta::
   :keywords: OEAddColorAtoms

.. oe:function:: OEAddColorAtoms

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

      .. oe:api::

         unsigned int OEAddColorAtoms(OEChem::OEMolBase& mol,
                                      const OEColorForceField& cff,
                                      bool setCachedSelfColor = false)
         unsigned int OEAddColorAtoms(OEChem::OEMCMolBase& mol,
                                      const OEColorForceField& cff,
                                      bool setCachedSelfColor = false)

   .. oe:language:: python

      .. oe:api:: python

         OEAddColorAtoms(mol: Union[OEGraphMol,OEQMol], cff: OEColorForceField,
                         setCachedSelfColor: bool = False) -> int
         OEAddColorAtoms(mol: OEMol, cff: OEColorForceField,
                         setCachedSelfColor: bool = False) -> int

   Add color atoms to the passed in molecule. Note that this is not
   normally required as both OEColorOverlap and OEBestOverlay make
   internal copies of molecules and add color atoms automatically, but if
   you continually re-use the same molecule, this can be an optimization.
   Additionally, setting *setCachedSelfColor* to true will pre-calculate
   and cache the self color on the molecule. This cached value will then
   be used by OEColorOverlap and OEBestOverlay. The value can be
   accessed via :oe:func:`OEShape::OEGetCachedSelfColor`.
