La guía de esta página solo está disponible en inglés por ahora.
How to mix an RGB color
- 1Move the Red, Green and Blue sliders, or type values from 0 to 255.
- 2Watch each slider's track: it previews the colors you'd get by moving only that channel.
- 3Set opacity if needed and copy the
rgb()orrgba()value.
The RGB color model
RGB is an additive model: screens create colors by combining red, green and blue light. All three at 0 is black; all three at 255 is white; equal values give grays. Red + green makes yellow, green + blue makes cyan, and red + blue makes magenta.
In modern CSS you can write rgb(37 150 190) or rgb(37 150 190 / 50%); the older comma syntax rgba(37, 150, 190, 0.5) is still supported everywhere.
Common RGB values
| Color | RGB | HEX |
|---|---|---|
| Black | rgb(0, 0, 0) | #000000 |
| White | rgb(255, 255, 255) | #FFFFFF |
| Red | rgb(255, 0, 0) | #FF0000 |
| Lime | rgb(0, 255, 0) | #00FF00 |
| Blue | rgb(0, 0, 255) | #0000FF |
| Mid gray | rgb(128, 128, 128) | #808080 |
Preguntas frecuentes
Why does RGB go from 0 to 255?
Each channel is stored in 8 bits, which can represent 256 values (0–255). Three channels give over 16.7 million colors.
What is the difference between RGB and RGBA?
RGBA adds an alpha channel for opacity, from 0 (transparent) to 1 (opaque).