<!-- PDF page 106 -->

Before we delve a bit deeper into what each does and how, it's very important to understand that the commands operate differently according to the *layer* we're on and this points back to the different way the ZX Spectrum Next stores colour. When we're dealing with modes that make use of *attribute cells*, we need to think in terms of those cells. **PAPER** there affects the background or, in other words, the place in the cell where graphic data is *non existent* (set to **0**) whereas **INK** does the exact opposite and affects areas within the same cell where graphic data is *existent* (set to **1**). Moreover these commands affect the entire *attribute cell* and not just one singular pixel within the cell. In other words, it doesn't matter how many times you set the **INK** or **PAPER** within a particular cell, only the *last command will be the one that has the permanent effect* for that cell. **BRIGHT** similarly affects the entire cell as we already saw, however it does absolutely nothing if *EnhancedULA* is enabled or if we are on modes that do not support attributes like *HiRes*, *LoRes* and *Layer 2*.

On *LoRes* and *Layer2*, since *attribute cells* do not exist, the entire notion of **PAPER** and **INK** should be irrelevant. It is easier, however, for the user to understand them in similar terms as the *attribute display* modes i.e. in terms of a *character-based* display. Indeed, there's nothing stopping us from having an 8 x 8 character drawn on screen (say a **2**) with every single *pixel* around the character having a different colour, something that's impossible on *attribute display* modes. This however would be very difficult to do in terms of a singular colour command and for that reason **PAPER** and **INK** commands were simply extended to work in a similar manner as their *attribute cell* modes' counterparts even where their underlying mechanics are different. On the other hand, in *HiRes* mode, **PAPER** and **INK** commands only serve the purpose of selecting a colour scheme as we will see below. The following table shows all primary colour commands functionality according to the graphics mode we're in.

<table>
<thead>
<tr><td rowspan="3"></td><th colspan="4">Attribute Modes</th><th colspan="3" rowspan="2">Non-Attribute Modes</th></tr>
<tr><th colspan="3">Standard ULA</th><th>EnhancedULA</th></tr>
<tr><th>Layer 0</th><th>Layer 1,1</th><th>HiColour</th><th>Layer 1,1, HiColour</th><th>HiRes</th><th>LoRes</th><th>Layer2</th></tr>
</thead>
<tbody>
<tr><th>INK</th><td>0-9<sup>***</sup></td><td colspan="2">0-7</td><td>0-255</td><td>0-7<sup>*</sup></td><td>0-255</td><td>0-255</td></tr>
<tr><th>PAPER</th><td>0-9<sup>***</sup></td><td colspan="2">0-7</td><td>0-255</td><td>0-7<sup>*</sup></td><td>0-255</td><td>0-255</td></tr>
<tr><th>BORDER</th><td colspan="3">0-7</td><td>0-7</td><td>0-7<sup>**</sup></td><td>0-7</td><td>0-7</td></tr>
<tr><th>FLASH</th><td>0-1,8<sup>***</sup></td><td colspan="2">0-1</td><td>N/A</td><td>N/A</td><td>N/A</td><td>N/A</td></tr>
<tr><th>BRIGHT</th><td>0-1,8<sup>***</sup></td><td colspan="2">0-1</td><td>N/A</td><td>N/A</td><td>N/A</td><td>N/A</td></tr>
<tr><th>Palette in use</th><td colspan="3">ULA</td><td>ULA</td><td>ULA</td><td>ULA</td><td>L2</td></tr>
</tbody>
<tfoot>
<tr><td colspan="8">*&nbsp;&nbsp; INK in HiRes is complimentary to PAPER i.e. when INK is 0 then PAPER is 7 and if INK is 3 then PAPER is 4 and so on.<br>
**&nbsp; BORDER has no effect but it's set by the PAPER setting<br>
*** INK/PAPER/BRIGHT/FLASH 8 mean Transparent, ergo it preserves the colour setting that was there previously and INK/PAPER 9 mean Contrast, ie. the complimentary colour of the other statement (something similar to PAPER/INK settings for HiRes modes)</td></tr>
</tfoot>
</table>

*Table 7 – Colour commands' functionality according to Graphics Mode/Layer*

There is another way of using **INK**, **PAPER** etc, which you will probably find more useful than having them as statements. You can put them as items in a **PRINT** statement (followed by ;), and they then do exactly the same as they would have done if they had been used as statements on their own, except that their effect is only temporary: it lasts as far as the end of the **PRINT** statement that contains them. Thus if you type:

```
PRINT PAPER 6;"x";: PRINT "y"
```

then only the **x** will be on a yellow background.

When used as statements in *Layer 0*, **INK**, **PAPER**, **BRIGHT** and **FLASH**, do not affect the colours of the lower part of the screen, where commands and **INPUT** data are typed in. The lower part of the screen uses the colour of the BORDER as its PAPER colour, value **9** for contrast as its INK colour, has FLASH turned off, and everything is set at normal BRIGHT.

