RISC OS 3.7 User Guide
15 Using colour in applications
Many of the applications you can run on your computer (such as Draw and Paint) make use of colour. This chapter uses Draw as an example.
Note: There are actually two ways of choosing colour in Paint, depending on the screen mode. In modes up to 256 colours, you'll choose colours from a standard Paint Colours window (see Paint on page 283). In 32-thousand or 16-million colour modes, you'll use the methods described in this chapter.
Colour models
First, here's a short explanation of the three different ways in which colour can be defined or specified: the colour models.
- RGB (Red, Green, Blue) - uses the principle of emitted colour
- CMYK (Cyan, Magenta, Yellow, Key) - uses the principle of reflected colour
- HSV (Hue, Saturation, Value) - uses the principle of reflected colour.
RGB
This colour model is the one used by colour monitors. They mix beams of red, green and blue light in different proportions to display colours. With the green beam switched on and the other two switched off, you see the colour green. Mixing red, green and blue together at full intensity produces white.
CMYK
This model works like an artist mixing colours on a palette. You see green on an artist's palette because the pigment being used absorbs every colour of the spectrum except for green, which it reflects back to your eye. Unlike the RGB model, if you mix all the colours on a palette together you get a muddy brown!
This model is used in four-colour process printing. Printers discovered that they can print any colour from a combination of cyan, magenta, yellow and black dots. They use white, too, but this is the paper colour, where no coloured ink is applied.
The black colour (Key) in CMYK is used to reinforce dark colours and grey shades that may otherwise appear muddy when printed.
HSV
The HSV colour model uses the principle of reflected colour too.
Hue is the basic look of the colour - a particular tint of red or green for example.
Saturation is the strength of the colour compared with the amount of white added. A green hue at full saturation (100%) is a very deep green, while a low saturation green has lots of white added, and is a very pale pastel green.
Value is the brightness of the colour compared with the amount of added black. 100% is the brightest (no added black), while 0% is all black.
Using colour in Draw
The Draw application uses colour extensively. You can choose different colours for the graphic objects and for text. All the colour options are in the Style menu. Graphics can be given a Line colour and a Fill colour. Clicking on one of these displays the RGB colour dialogue box:
The RGB, CMYK and HSV option buttons allow you to toggle between the three different colour models.
Which colour model?
Each of the colour models has its own colour selection dialogue box. Which is the best one to use? Well, that depends on the colour you want to end up with, and whether you're already familiar with a particular model. Each model has its pros and cons.
Using the RGB colour model
There are six ways of choosing a colour in the RGB model. You can use one or a combination of two or more to choose the colour you want. The easiest ways are:
- Click anywhere in the colour box. You can also drag continuously around it.
- Drag the bars in the sliders. As you move the slider the colour you have chosen is shown in the box at the bottom left of the window. At the same time the numeric values change to show you the percentages of the colours chosen.
The other four ways apply to all the colour model dialogue boxes - see Specifying a colour accurately on page 184.
Click on OK to apply your chosen colour to the selected tool or graphic object. Cancel ignores any colour changes you've just made.
Using the CMYK colour model
The colours in CMYK are added together. The amount of each colour can range from 0% (no colour) to 100% (full colour).
There are five ways of choosing a colour in the CMYK model. The first is the easiest:
Drag the bars in the sliders. As you move the slider the colour you have chosen is shown in the box at the bottom left of the window. At the same time the numeric values change to show you the percentages of the colours chosen.
The other four ways apply to all the colour model dialogue boxes - see Specifying a colour accurately on page 184.
Click on OK to apply your chosen colour to the selected tool or graphic object. Cancel ignores any colour changes you've just made.
Using the HSV colour model
Click on the HSV button to display the HSV colour dialogue box.
The HSV colour model is useful for trying out different shades of the same colour - pick a colour then add black to it to make it darker, or add white to it to make it lighter (more of a pastel shade).
- 1 Choose the Hue you want by clicking on a colour in the colour box. The Hue will appear in the trial box at the bottom lefthand corner of the window, and as a number (in degrees) in the Hue writable icon.
- 2 Click on the Hue option button to make the hue constant while you change the Saturation and Value.
- 3 Drag the bottom slider to add white (to make the colour lighter) or to subtract white (to make it stronger).
- 4 When you have the right Saturation, drag on the lefthand slider to change the Value - to make the colour darker, if you want to.
Click on OK to apply your chosen colour to the selected tool or graphic object. Cancel ignores any colour changes you've just made.
Specifying a colour accurately
You can use the writable fields or up/down arrows in any of the three colour model dialogue boxes to specify a colour very accurately:
- If you know the percentages of the colour you want then it is easiest to type it into the writable fields directly. Use the Tab key to move between fields.
- You can fine-tune the currently selected colour by clicking on the up/down arrows. This changes the value in the appropriate writable field by 1%. Clicking with Shift held down changes the value by 0.1%.
- Click on one of the sixteen standard colours. This gives you access to the standard desktop colours directly.
- Click on None. The selected text or graphic will be transparent. This is especially useful in sprites (see page 303). This button may be greyed out if not applicable.
Colour and the desktop
Although the desktop can be set to display only black and white, a number of shades of grey, 16 colours, 256 colours, 32 thousand colours or 16 million colours, you can always choose from 16 million. The application stores this exact colour information, even if you are working in a 16-colour screen mode.
The screen and colour selection box only show an approximation of what you've chosen; in a 16-colour display mode the representation will not be very accurate. The colour shown in the Colour picker can be different to that displayed in an application.
Colour information is stored within the application and is not lost when you change modes.
You can still choose colours when the desktop is in a greyscale mode - it is probably best to specify the colours by numerical value in this case, as otherwise you will have no idea from the appearance of the desktop what sort of colour you have chosen. If you particularly want to select a shade of grey in your application, use the CMYK model and set all colours except for Black at 0%.
RISC OS 3.7 User Guide - 22 JAN 1997