.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2020 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc

.. module:: wx.lib.colourutils

.. currentmodule:: wx.lib.colourutils

.. highlight:: python



.. _wx.lib.colourutils:

==========================================================================================================================================
|phoenix_title|  **wx.lib.colourutils**
==========================================================================================================================================

Some useful colour-related utility functions.


|function_summary| Functions Summary
====================================

================================================================================ ================================================================================
:func:`~wx.lib.colourutils.AdjustAlpha`                                          Adjust the alpha of a given colour
:func:`~wx.lib.colourutils.AdjustColour`                                         Brighten/darken input colour by `percent` and adjust alpha
:func:`~wx.lib.colourutils.BestLabelColour`                                      Get the best color to use for the label that will be drawn on
:func:`~wx.lib.colourutils.GetHighlightColour`                                   Gets the default highlight color.
================================================================================ ================================================================================


|



Functions
------------

.. function:: AdjustAlpha(colour, alpha)

   Adjust the alpha of a given colour
   
   :param integer `alpha`: the new value for the colour alpha channel (between 0
    and 255).
   
   :rtype: :class:`wx.Colour`
   :returns: A new :class:`wx.Colour` with the alpha channel specified as input


.. function:: AdjustColour(color, percent, alpha=wx.ALPHA_OPAQUE)

   Brighten/darken input colour by `percent` and adjust alpha
   channel if needed. Returns the modified color.
   
   :param wx.Colour `color`: color object to adjust;
   :param integer `percent`: percent to adjust +(brighten) or -(darken);
   :param integer `alpha`: amount to adjust alpha channel.
   
   :rtype: :class:`wx.Colour`
   :returns: A new darkened/lightened :class:`wx.Colour` with the alpha channel
    specified as input


.. 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 wx.Colour `color`: background color that text will be drawn on;
   :param bool `bw`: If ``True``, only return black or white.
   
   :rtype: :class:`wx.Colour`


.. function:: GetHighlightColour()

   Gets the default highlight color.
   
   :rtype: :class:`wx.Colour`


