.. include:: headings.inc .. module:: lib.colourutils .. currentmodule:: lib.colourutils .. highlight:: python .. _lib.colourutils: ========================================================================================================================================== |phoenix_title| **colourutils** ========================================================================================================================================== Some useful colour-related utility functions. |function_summary| Functions Summary ==================================== ================================================================================ ================================================================================ :func:`~lib.colourutils.AdjustAlpha` Adjust the alpha of a given colour :func:`~lib.colourutils.AdjustColour` Brighten/Darken input colour by percent and adjust alpha :func:`~lib.colourutils.BestLabelColour` Get the best color to use for the label that will be drawn on :func:`~lib.colourutils.GetHighlightColour` Get the default highlight color ================================================================================ ================================================================================ | Functions ------------ .. function:: AdjustAlpha(colour, alpha) Adjust the alpha of a given colour .. function:: AdjustColour(color, percent, alpha=ALPHA_OPAQUE) Brighten/Darken input colour by percent and adjust alpha channel if needed. Returns the modified color. :param Colour `color`: color object to adjust :param integer `percent`: percent to adjust +(brighten) or -(darken) :keyword `alpha`: amount to adjust alpha channel .. function:: BestLabelColour(color, bw=False) Get the best color to use for the label that will be drawn on top of the given color. :param Colour `color`: background color that text will be drawn on :keyword `bw`: If True, only return black or white .. function:: GetHighlightColour() Get the default highlight color :return: :class:`Colour`