RISC OS uses two different methods of managing colours in 256 colour screen modes. In all other colour screen modes, the colour systems are identical. Although, 256 colour screen modes are getting less common with the advancement in technology, it is important to understand how it differs.
The format of the palette entries to request a physical colour is in the same format as that used to set the anti-alias palette in the font manager.
The GCOL code is used to define a colour using 1-byte. The format of the byte is as follows:
Bit | Meaning |
---|---|
0 | Tint bit 0 (red+green+blue bit 0) |
1 | Tint bit 1 (red+green+blue bit 1) |
2 | Red bit 2 |
3 | Red bit 3 (high) |
4 | Green bit 2 |
5 | Green bit (high) |
6 | Blue bit 2 |
7 | Blue bit 3 (high) |
This data format is converted into the standard colour number format when stored.
The colour number in a 256 colour screen mode is defined using 1-byte. The format is as follows:
Bit | Meaning |
---|---|
0 | Tint bit 0 (red+green+blue bit 0) |
1 | Tint bit 1 (red+green+blue bit 1) |
2 | Red bit 2 |
3 | Blue bit 2 |
4 | Red bit 3 (high) |
5 | Green bit 2 |
6 | Green bit 3 (high) |
7 | Blue bit 3 (high) |
The bottom 4 bits of the colour number are obtained via the palette.
The palette entry is made up of a word of data in the &BBGGRR00
format.
It consists of four bytes, with the palette value for the blue, green and red in the top three bytes. e.g White is made up of &FFFFFF00
.