Three primitives allow to colour a figure. The primitive fill, fillzone and fillpolygon. .
These primitives allow a shape to be coloured in. These primitives can be compared with the ’fill’ feature available in many image-retouching programs. This feature can extend to the margins of the design area. There are two rules that must be adhered to in order to use this primitive correctly:
Let’s take a look at an example to see the difference between fill and fillzone:
The pixel under the turtle is white right now. The primitive fill will colour all the neighbouring white pixels with the current pen colour. If for example, you type: setpc 1 fill.
Let’s now go back to the first case, if the pen colour of the turtle is black, the primitive fillzone colours all pixels until it encounters the current colour (here black).
This is a good example of the use of this primitive:
Step 1 | Step 2 | Step 3 | Step 4 |
Step 1 | Step 2 | Step 3 | Step 4 | Step 5 |