Showing changes from revision #6 to #7:
Added | Removed | Changed
Among other aspects of its window environment the Wimp permits configuration of colour. An application has control over the colour of text, of window outlines and of many others parts. The Wimp provides different methods for managing the colour of applications:
Type | Description |
---|---|
Basic | Uses one of 16 possible colours |
Advanced | Uses 24-bit colour |
The Wimp knows which method to use by checking the Extra Window Flags within a windows definition.
Note: The advanced approach to colour handling requires at least version x.xx of the Window Manager.
The Wimp uses 16 pre-set colours which are mapped to the available colours in the current screen mode, regardless of whether there are more or fewer available colours.
The available colours are:
Colour # | Colour | Default Usage |
---|---|---|
0 | White | |
1 | Grey(1) | Work area background, icon bar background, scroll bar inner |
2 | Grey(2) | Title background |
3 | Grey(3) | Scroll bar outer |
4 | Grey(4) | Desktop background |
5 | Grey(5) | |
6 | Grey(6) | |
7 | Black | Title text, window text |
8 | Dark Blue | |
9 | Yellow | |
10 | Green | |
11 | Red | |
12 | Cream | Title background – Input focus |
13 | Army Green | |
14 | Orange | |
15 | Light Blue |
The following tables details how the Wimp maps the 16 pre-set Wimp colours within non-16 colour screen modes.
16 Colour # | Mapping |
---|---|
0 | White |
1-6 | Patterned |
7 | Black |
8-15 | White or Black (closest Match) |
<br \>
h5. 4 Colour Mode
16 Colour # | Mapping |
---|---|
0 | White |
1 | Light grey |
2 | Dark grey |
3 | Black |
8-15 | White or Black (closest Match) |
Translation to closest possible colour is undertaken. However, an exact match may not always be possible. |
Note: Manual translation of colours is possible if required. An application should use the ColourTrans module to achieve this
The Wimp translates colours when the current screen mode does not match the required colour depth. The following table shows when translations occur and any exceptions.
When | Exceptions |
---|---|
Windows | Translation of colours unless explicitly told otherwise. This is set within the windows windows flags using bit 10 |
Sprites | Colour translations are provided by the OS_SpriteOp reason code &34 (52) |
Icons | Patterned colours in icons cannot be displayed within 2-colour modes |
Caret | Translations of colours unless told otherwise |
The Wimp can also handle Colours using 24-bit colour.
The table below details which parts of a window can be set with 24-bit colour.
# | Window Element |
---|---|
1 | Title text |
2 | Title background |
3 | Work area text |
4 | Work area background |
5 | Scroll bar inner |
6 | Scroll bar outer |
The colours are in the format BBGGRR
.
Where 24-bit colour has been specified for a window, but a particular window element has not got it’s colour set, then the Wimp will use the applicable default 16 colour equivalent.
Manual translation of colours is possible if required. An application should use the ColourTrans module to achieve this.
The Wimp will issue an event code when the palette changes because of a change of screen mode. This allows applications to know about the change so they can update their content.
The Wimp issues Message_ModeChange which applications should respond to so that any mode specific data can be changed.
For a full detailed description on colour, please see the RISC OS Style Guide.