Binary Bulbs
Explore numbers, color, and sound with bits.
Why those place values matter
Each step to the left doubles the value. The powers of two count those steps, starting with 20 = 1 on the right.
True Color · 24 Binary Bulbs
You are choosing one of 16,777,216 colors. Each slider changes a whole byte of bulbs. Each bulb changes one bit.
Switch a color group off to remove its eight bits. Switching it back on restores its previous value. A slider at 0 turns all eight bulbs off; at 255, all eight are on. Color presets and the color-number box use all three channels.
What does 224 represent?
Every bulb has 2 possible states: off or on. With 24 bulbs, there are 24 groups of 2 choices multiplied together. Each different 24-bit pattern represents one RGB color.
Eight red bits give 256 red levels, including 0. Green and blue each have 256 levels too. A 24-bit RGB color is commonly called true color.
| Channels available | Bits you can change | Possible colors |
|---|---|---|
| 0 · all off | 0 | 20 = 1 (black) |
| 1 · red, green, or blue | 8 | 28 = 256 |
| 2 · any pair | 16 | 216 = 65,536 |
| 3 · red + green + blue | 24 | 224 = 16,777,216 |
These totals count every setting the available sliders could use. A channel set to 0 still has 256 possible settings while its group is available.
Your selected color as one number
The red byte occupies the left eight bits, followed by green and blue. That is why red is multiplied by 65,536 and green by 256. Try entering , , , or in the color-number box and watch which groups change.
Why do the presets show only eight colors?
If each whole red, green, or blue group can only be fully off or fully on, there are just 2 × 2 × 2 = 8 colors. The sliders let each group use all 256 levels, including the shades in between.
Try this: make yellow with red and green at 255 and blue at 0. Switch blue on, then turn on only its bulb worth 1. The color number increases by 1.
Binary Bulbs · Audio
A sound wave can be stored as a sequence of numbers called samples. Choose a sample below, then change its eight bulbs and listen to what happens.
10000000These are unsigned 8-bit PCM samples: 0 is the lowest wave position, 128 is the midpoint, and 255 is the highest. We repeat these 16 samples to make a tone. Each bulb changes one sample’s position in the wave.
Compare the sine and square waves at the same repeat rate. Explore the full binary audio lesson →