Colours Feature Image SDL3

Colours in Computer Graphics


Understanding Colours in Computer Graphics

The colour is composed of four components, RGBA, that is red, green, blue and the alpha value.

The physical screen consists of many small units. Every unit itself consists of three different coloured lights. These colours are red, green and blue. If you mix them up, you can get every other colour. These colours are mixed up additively. For example if you mix red and green you get yellow. For three colours that can be mixed with each other, there are eight combinations possible which lead to different colours:

  • RGB: white
  • RG: yellow
  • RB: magenta
  • R: red
  • GB: cyan
  • G: green
  • B: blue
  • all lights off: black.

Some may say, white and black are no colours at all. Well, that is right but doesn’t matter here and to keep it simple I will take them as colours.

Your screen has more than eight colours, doesn’t it? The reason is, your screen isn’t just able to switch lights on or off. Besides it is able to differ the intensities of the lights. The more intensity levels you have, the more colours you can display. The case that you have eight colours as discussed before means that you just have one intensity level, on or off. If your screen is in 8 bit mode, every pixel on the screen has the possibility to display 2 to the power of 8 colours. That are 256 different colours. Each of the three lights are adjusted according to the requested colour.

In 16 bit mode you have 2 power 16 and that are 65536 colours. Each light therefore has the appropriate amount of intensity levels. In 24 bit mode (“True Color”) we have overwhelming 16.7 million colours! – But make no mistake, in 32 bit mode only the 8 bit alpha channel is added, so we still have 16.7 million colours, but now there are additional 256 levels of transparency.

2 thoughts on “Colours in Computer Graphics

  1. Actually, no. We have 3 basic colours of 8 bits, so 24 bits, or 16.7 million colours. The A channel does not make new colours. All values of A on a given RGB value merely results in a new RGB value to be displayed, depending on what lies “behind” the pixel (there are no A LEDs in a monitor, only R,G,B)

    1. Hey HeartWare, thanks a lot for the clarification! Has a been a decades old text, but updated it now. Let me know, if still something is wrong :).

Leave a Reply

Your email address will not be published. Required fields are marked *