Table Of Contents

Previous topic

ColourSelectEvent

Next topic

combotreebox

This Page

phoenix_title colourutils

Some useful colour-related utility functions.

function_summary Functions Summary

AdjustAlpha Adjust the alpha of a given colour
AdjustColour Brighten/Darken input colour by percent and adjust alpha
BestLabelColour Get the best color to use for the label that will be drawn on
GetHighlightColour Get the default highlight color

Functions



AdjustAlpha(colour, alpha)

Adjust the alpha of a given colour



AdjustColour(color, percent, alpha=ALPHA_OPAQUE)

Brighten/Darken input colour by percent and adjust alpha channel if needed. Returns the modified color.

Parameters:
  • color (Colour) – color object to adjust
  • percent (integer) – percent to adjust +(brighten) or -(darken)
  • alpha – amount to adjust alpha channel


BestLabelColour(color, bw=False)

Get the best color to use for the label that will be drawn on top of the given color.

Parameters:
  • color (Colour) – background color that text will be drawn on
  • bw – If True, only return black or white


GetHighlightColour()

Get the default highlight color

Returns:Colour