Blitz3D+ Command Reference

GuiThemeColor ( role )

Parameters

role - which colour to return:
0: the window surface
1: a layer - the surface of tab pages
2: a card - bordered panels and lists
3: text
4: secondary text - hints and less important words
5: the accent - selections and default buttons
6: dividers and frames
7: text on the accent

Description

Returns one of the colours your GUI is being drawn with, as $RRGGBB, so that anything you draw yourself - a canvas, a chart, a colour swatch - looks part of the window.

The colours follow the theme being drawn: Light, Dark or Classic, which uses the colours Windows is set to, including high contrast. When the theme changes, a theme change event ($2006) arrives; ask for the colours again and redraw.

Split the value into its parts for Color and ClsColor:

card=GuiThemeColor(2)
ClsColor (card Shr 16) And 255,(card Shr 8) And 255,card And 255
Cls
ink=GuiThemeColor(3)
Color (ink Shr 16) And 255,(ink Shr 8) And 255,ink And 255
Text 20,20,"Drawn in the theme's colours"

A role other than 0 to 7 causes a runtime error.

See it working in the 12_Themes.bb sample, which draws a chart in the theme's colours and redraws it when the theme changes.

Requires Extended mode.

See also: GuiTheme, SetGuiTheme, CanvasBuffer, SetPanelColor.

Index