Binary representation · RGB encoding
Binary Painter
Flip 8 binary switches and watch a color appear. Real RGB encoding, hands-on.
Computers store colors as numbers. This demo uses the RGB332 scheme — 8 bits split across red (3), green (3), and blue (2). Flip the switches and watch the binary value, decimal value, hex code, and resulting color all update together. The relationship between the four representations is the relationship every graphics system on the planet runs on.
What’s happening under the hood
- ›Each switch contributes a power of 2 to its channel: bit 7 = 128, bit 6 = 64, bit 5 = 32, and so on.
- ›RGB332 (used here) fits one pixel in 1 byte. Modern displays use 24-bit RGB (8 bits per channel) — same idea, more precision.
- ›The hex code (e.g. #FF0040) is the same byte sequence in base 16. Designers, browsers, and CSS all use this notation for the same underlying bits.
Dig deeper
Phase 0 · How Computers ThinkThe concept you just explored is taught with full depth in the formal DURA curriculum.