INK
instruction: set drawing colour
Ink number
Ink number,pattern,border
You are not restricted to the pre-set colours that have been allocated for drawing operations. The INK command is used to specify which colour is to be used for subsequent drawing, and the number of the colour register is set like this:
E> Cls: Ink 5 Draw To 319,199
The INK instruction can also be used to set patterns for filling shapes, as well as colours for borders around shapes, and this will be explained later. The next concept to understand is how different colours are mixed.
Every shade of colour displayed on your television set or monitor is composed of various mixtures of the same three primary colours: Red, Green and Blue (RGB for short). There is a range of 16 intensities available for each of the RGB levels in every colour. A zero level is equivalent to "none" of that colour (black), and the maximum intensity of 16 is the equivalent of "all" of that colour. Because there are three separate components each with 16 possible strengths, the maximum range of available shades is 16 times 16 times 16, in other words 4096 possible colours.
The Amiga prefers to recognise colours by their RGB components, given in hexadecimal values, known as "hex". The following table shows the equivalent decimal and hex values for the 16 numbers involved:
Hex digit 0 1 2 3 4 5 6 7 8 9 A B C D E F Decimal 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
COLOUR
function: read the colour assignment
c=Colour(index)
It is not difficult to find which colours are occupying the colour index, and analyse how much Red, Green and Blue is used to make up each shade. The COLOUR function can take an index number from 0 to 31, and returns the colour value assigned to that number. Hex$ is used for this purpose, as follows:
E> Curs Off : Flash Off For C=0 To 15: Ink C Print Hex$(Colour(C),3) Circle 160,75,(C+1)*4 Next C