I’m experimenting with colour in my ZIL, looking ideally to change the whole background colour and also the text colour.
I’ve added <COLOR 5 8> to my code and the result is a little funky! It has only changed certain areas, the rest remain the default colour (brown and orange).
With the Z-Machine, changing the colours just affects all future output - anything already on the window stays as it is. If you want the whole window to update to the new colours, you have to erase the window.
Note that, if you subtract two from all of these, they’re easier to remember: the 0x1 bit is the red channel, the 0x2 bit is the green channel, and the 0x4 bit is the blue channel. (They’re shifted by two to make room for 0=current and 1=default.)
The three grays, along with 15=transparent and -1=whatever’s under the cursor, I believe were added in Z6. Which is why they don’t fit the pattern of the others.
of course, back in Infocom days (and the variety of machines and text mode palettes) colour number wasn’t associated to a specific machine… so I think that is unwise assigning color names to the numbers (only the C=64 has three grays in its 16 colour palette; 8 bit Atari has a single-color for the text mode, char and background being differentiated by their luminance; Amiga text mode has only four colours from a palette of 4096, and so on)