RGB is a digital way to create colors by mixing red, green, and blue. Instead of using paint, you give each color a numeric intensity: 0 means none, while 255 means the strongest amount. Combining three values produces a wide palette for web pages. section 17.1
Build an RGB color in three small steps:
- Choose a red value, a green value, and a blue value. section 17.1
- Use lower numbers for softer intensity and higher numbers for stronger intensity. section 17.1
- Blend the components: one nonzero component makes a pure color, while multiple nonzero components create a mixture. section 17.1
A tiny RGB palette
Red is (255, 0, 0), blue is (0, 0, 255), and yellow is (255, 255, 0). Equal component values create grayscale: (0, 0, 0) is black, (128, 128, 128) is gray, and (255, 255, 255) is white. section 17.1
| Name | Red | Green | Blue | Color |
| Red | 255 | 0 | 0 | |
| Green | 0 | 255 | 0 | |
| Blue | 0 | 0 | 255 | |
| Yellow | 255 | 255 | 0 | |
| Magenta | 255 | 0 | 255 | |
| Cyan | 0 | 255 | 255 | |
| Black | 0 | 0 | 0 | |
| Gray | 128 | 128 | 128 | |
| White | 255 | 255 | 255 |
Use the color table as a quick reference for primary colors, blends, and grayscale values. section 17.1
For web work, RGB values also appear in compact hexadecimal color codes. For example, #3366cc and #36c represent the same color when each pair repeats its character. Try identifying the codes for blue and the lightest gray in an online exercise. section 17.13




