RGB

Share

What is RGB?

The term RGB has two meanings:

  1. Red, Green, and Blue.
  2. A marketing term for rainbow-light colored hardware for gamers.

Why Red, Green, and Blue?

Red, green, and blue are the three primary colors when you consider light as a color system: when red, green, and blue light are combined, you get white light.

The way computer graphics work is that colors are captured from the real world by cameras and turned into RGB values, which are then reproduced on computer screens by making RGB lights shine at varying intensities.

For example, say we take a photo of a yellow wall. We can make yellow light by combining a red light with green light. Since we have 3 lights, RGB, that means R and G would need to be at 100% intensity, while B would be at 0% intensity.

A typical computer image is composed of millions of pixels with each pixel having a single RGB color.

RGB colors are typically stored in a data structure of 3 bytes, one byte for each light (also called a channel). As we can store a number from 0 to 255 in a byte, we would have, for example, 255, 255, 0 for red, green, blue at 100%, 100%, 0% intensities.

We can write bytes as hexadecimal numbers, e.g. FF, FF, 0.

From this, we have the typical way of representing RGB colors, as RGB hex codes: #FFFF00.

Transparency

RGB plus a transparency channel is called RGBA (Red, Green, Blue, Alpha).

Comments

Leave a Reply

Leave your thoughts! Required fields are marked *