Back to Lingo

RGB

Data Encoding

RGB is a color model that creates colors by combining red, green, and blue light at different intensities. Each color channel is typically represented by a value from 0 to 255, which corresponds to one byte or eight bits of data. By mixing these three primary colors of light, screens can produce millions of different colors. RGB is the standard color model for displays, digital cameras, and web design.

Why it matters

Understanding RGB helps you work with colors in web development, graphic design, and any visual programming. When you write CSS colors in your frontend projects, edit images, or create user interfaces, you are working with RGB values. The model also illustrates how binary data translates into something visual—each pixel on your screen is really just three numbers being displayed as light.

How RGB values work

Each channel ranges from 0 (no light) to 255 (full intensity). These limits exist because each channel uses one byte, and a byte can store values from 0 to 255 in binary. Pure red is (255, 0, 0), pure green is (0, 255, 0), and pure blue is (0, 0, 255). White is all channels at maximum (255, 255, 255), while black is all channels at zero (0, 0, 0). Yellow is red plus green (255, 255, 0), and mixing all three at equal values produces shades of gray.

Color notation

RGB colors are written in different formats depending on context. In CSS, you might see rgb(255, 128, 0) for a bright orange. Hexadecimal notation like #FF8000 represents the same color, where FF is 255 in hex for red, 80 is 128 for green, and 00 is 0 for blue. The lesson Where Number Systems Are Used explains how hex color codes work in detail. Some systems also use RGBA, which adds a fourth channel for transparency (alpha). With three channels at 256 possible values each, RGB can represent over 16 million unique colors.

See more

Further reading

You need to be signed in to leave a comment and join the discussion