RISC OS Open
A fast and easily customised operating system for ARM devices
ROOL
Home | News | Software | Bugs | Bounties | Forum | Documents | Photos | Contact us
Account

ColourTrans Colours

Programmer's Reference Manuals
» Part 8 - Non-kernel input/output
» ColourTrans
» Technical Details
» Colours

Colours

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.

GCOL

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.

Colour Number

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.

Palette Entry

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.

Created on September 24, 2009 13:56:00 by Alan Robertson (52)? (127.0.0.1)
Edit | Views: Print | Source | Linked from: ColourTrans Technical Details

Search the Wiki

Commercial use

For commercial enquiries, please contact the owners of RISC OS, Castle Technology Ltd.

ROOL Store

The official C/C++ Development kit and more here.

Donate! Why?

Help ROOL make things happen – please consider donating!

Navigation

  • Home Page
  • All Pages
  • Recently Revised
  • Authors
  • Feeds
Site design © RISC OS Open Limited 2011 except where indicated
The RISC OS Open Instiki theme is based on Insitki's default layout

Valid XHTML 1.0  |  Valid CSS

Instiki 0.19.1(MML+)
This site runs on Rails

Hosted by Arachsys