1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
|
.. wxPython Phoenix documentation
This file was generated by Phoenix's sphinx generator and associated
tools, do not edit by hand.
Copyright: (c) 2011-2018 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`
|