RGB Renk Modeli: Ekranlar Rengi Nasıl Gösterir?
Embed This Widget
Add the script tag and a data attribute to embed this widget.
Embed via iframe for maximum compatibility.
<iframe src="https://colorfyi.com/iframe/entity//" width="420" height="400" frameborder="0" style="border:0;border-radius:10px;max-width:100%" loading="lazy"></iframe>
Paste this URL in WordPress, Medium, or any oEmbed-compatible platform.
https://colorfyi.com/entity//
Add a dynamic SVG badge to your README or docs.
[](https://colorfyi.com/entity//)
Use the native HTML custom element.
Every pixel on your monitor, phone, or television is a tiny cluster of three lights: one red, one green, one blue. By controlling the intensity of each light independently, a screen can produce virtually any color the human eye can perceive. This is the RGB color model, and understanding how it works gives you precise control over color in CSS, design tools, and digital production.
This guide explains red-green-blue light mixing from first principles, walks through the additive color model, explains the 0–255 intensity range, covers the CSS rgb() function in its modern and legacy forms, and shows how the math behind RGB produces the famous figure of 16.7 million possible colors.
Red, Green, and Blue: Why These Three?
The choice of red, green, and blue is not arbitrary — it is grounded in the biology of human vision.
The human retina contains three types of cone cells, each sensitive to a different range of light wavelengths:
- L-cones: peak sensitivity around 560 nm (perceived as red-orange)
- M-cones: peak sensitivity around 530 nm (perceived as green)
- S-cones: peak sensitivity around 420 nm (perceived as blue-violet)
By stimulating these three cone types in different proportions, a screen can trigger the same visual experience as any natural light source. You are not actually seeing "the same color as a ripe lemon" — you are seeing red and green phosphors lit at specific intensities that stimulate your L and M cones in the same ratio as yellow light would.
This is why RGB works for screens: it directly maps to the biological structure of human color vision.
The specific primaries that display manufacturers settled on — the particular shades of red, green, and blue — are defined by the sRGB color standard, established by HP and Microsoft in 1996. The sRGB primaries are:
- Red: approximately 614 nm
- Green: approximately 533 nm
- Blue: approximately 465 nm
The Additive Color Model
RGB is an additive color model, which means colors are created by adding light together. This is the opposite of how paint or ink works.
Light Adds Toward White
In the additive model: - Adding no light at all produces black — complete absence of any wavelength - Adding all three primaries at full intensity produces white — the full combination of all wavelengths - Adding red and green at full intensity produces yellow (#FFFF00) - Adding red and blue at full intensity produces magenta (#FF00FF) - Adding green and blue at full intensity produces cyan (#00FFFF)
These secondary colors of light — yellow, magenta, and cyan — are the same as the primary colors of print (CMY). This reciprocal relationship is why the additive and subtractive models complement each other.
| Combination | Result | Hex |
|---|---|---|
| R: 255, G: 0, B: 0 | Red | #FF0000 |
| R: 0, G: 255, B: 0 | Green | #00FF00 |
| R: 0, G: 0, B: 255 | Blue | #0000FF |
| R: 255, G: 255, B: 0 | Yellow | #FFFF00 |
| R: 255, G: 0, B: 255 | Magenta | #FF00FF |
| R: 0, G: 255, B: 255 | Cyan | #00FFFF |
| R: 255, G: 255, B: 255 | White | #FFFFFF |
| R: 0, G: 0, B: 0 | Black | #000000 |
Why Additive Mixing Feels Counterintuitive
If you learned color theory using paint as a child, additive mixing can feel wrong. Mixing red and green paint produces a muddy brown. Mixing red and green light produces yellow. The difference is the physical mechanism:
- Paint absorbs wavelengths it does not reflect (subtractive). Mixing paints increases the range of absorbed wavelengths, darkening the result.
- Light emits wavelengths directly (additive). Mixing light sources increases the total energy reaching the eye, brightening the result.
Understanding this distinction is essential when converting colors between RGB (screen) and CMYK (print) — they operate on fundamentally different physical principles. Use ColorFYI's Color Converter when you need to move between the two.
The 0–255 Range Explained
Each of the three RGB channels — red, green, and blue — is represented as an integer from 0 to 255.
- 0 means that channel contributes no light at all (off)
- 255 means that channel is at maximum brightness (fully on)
- Values in between represent intermediate intensities
The choice of 0–255 comes directly from digital storage. Each channel is stored in 8 bits (1 byte). Eight bits can represent 2^8 = 256 distinct values, numbered 0 through 255. This is why 8-bit color is also called "24-bit color" — three channels of 8 bits each = 24 bits per pixel.
The 256 Levels Are Not Perfectly Linear
A critical nuance: the steps from 0 to 255 are not perceptually linear. Human vision is more sensitive to differences in darker tones than in lighter tones. If you increase a channel from 10 to 20, you perceive a larger change than if you increase it from 200 to 210, even though both are a difference of 10 units.
This is why modern color spaces like OKLCH apply gamma correction and perceptual lightness adjustments. For most CSS work, you do not need to think about this directly — but it explains why mixing colors in RGB often produces visually "muddy" results at midpoints that mixing in OKLCH does not.
Reading RGB Values in Practice
When you see the hex code #3B82F6 (a bright blue), the three pairs of hex digits correspond to the three channels:
3B→ decimal 59 → Red at 59/255 intensity82→ decimal 130 → Green at 130/255 intensityF6→ decimal 246 → Blue at 246/255 intensity
Hex is simply a more compact representation of the same 0–255 values, using base-16 notation. A hex pair from 00 to FF maps directly to a decimal value from 0 to 255.
The CSS rgb() Function
CSS exposes the RGB model through the rgb() function, allowing you to specify colors using the familiar 0–255 channel values directly in your stylesheets.
Legacy Syntax (CSS3)
The original CSS3 syntax uses comma-separated values:
color: rgb(59, 130, 246); /* Tailwind blue-500 */
color: rgb(239, 68, 68); /* Tailwind red-500 */
color: rgb(34, 197, 94); /* Tailwind green-500 */
This is equivalent to the hex codes #3B82F6, #EF4444, and #22C55E respectively.
Modern Syntax (CSS Color Level 4)
CSS Color Level 4 introduced a space-separated syntax that brings rgb() in line with other modern color functions like oklch() and lab(). The comma is optional:
/* Space-separated (modern) */
color: rgb(59 130 246);
/* With alpha channel using / notation */
color: rgb(59 130 246 / 0.5); /* 50% opacity */
color: rgb(59 130 246 / 75%); /* 75% opacity */
The / followed by an alpha value replaces the older rgba() function. In modern CSS, rgb() and rgba() are functionally identical — rgb() now accepts an optional alpha parameter.
Percentage Syntax
You can also express channel values as percentages rather than integers:
color: rgb(23% 51% 96%); /* Approximately Tailwind blue-500 */
color: rgb(100% 100% 100%); /* White */
color: rgb(0% 0% 0%); /* Black */
Percentages are less common in practice because the 0–255 range is more intuitive for most developers working with design tool outputs.
Dynamic Colors with CSS Custom Properties
The CSS rgb() function becomes especially powerful when combined with custom properties (CSS variables), allowing you to build configurable color systems:
:root {
--brand-r: 59;
--brand-g: 130;
--brand-b: 246;
}
.button {
background-color: rgb(var(--brand-r) var(--brand-g) var(--brand-b));
}
.button-muted {
background-color: rgb(var(--brand-r) var(--brand-g) var(--brand-b) / 0.15);
}
This pattern lets you update a single set of channel variables to retheme components across an entire stylesheet.
16.7 Million Possible Colors: The Math
The often-cited figure of "16.7 million colors" comes directly from the RGB channel math:
- Each channel (R, G, B) has 256 possible values (0 through 255)
- Three independent channels: 256 × 256 × 256 = 16,777,216
This is precisely 2^24, the number of unique 24-bit combinations. Every color from #000000 (pure black) to #FFFFFF (pure white) and every combination in between is one of these 16,777,216 states.
To visualize the scale:
| Channels in Use | Color Count |
|---|---|
| 1 channel (R only) | 256 grays |
| 2 channels (R + G) | 65,536 combinations |
| All 3 channels (R + G + B) | 16,777,216 colors |
Can the Human Eye Tell Them Apart?
Research suggests humans can distinguish approximately 10 million colors under optimal conditions — so 16.7 million in the color space is more than enough to represent every perceptibly distinct color. However, the distribution is not perceptually uniform. In darker regions of the RGB cube, many adjacent values look identical; in the midrange, differences are more visible.
This non-uniform perceptibility is why color spaces designed for perceptual uniformity — like CIELAB and OKLCH — are increasingly used in design systems and CSS. They distribute color steps so that equal numeric differences produce equal visible differences.
10-bit and 12-bit Color
Modern HDR displays are moving to 10 bits per channel (1,024 values per channel) and even 12 bits per channel (4,096 values per channel). This dramatically expands the range:
- 10-bit: 1,024³ = approximately 1.07 billion colors
- 12-bit: 4,096³ = approximately 68.7 billion colors
However, standard CSS rgb() still operates in 8-bit (0–255) per channel. Wide-gamut and HDR colors in CSS are accessed through other color functions (oklch(), color(display-p3), color(rec2020)) rather than through rgb().
Practical Tips for Working with RGB
Converting Between RGB and Hex
To convert hex to RGB manually, split the hex code into three pairs and convert each from base-16 to base-10:
- #FF6B6B →
FF= 255,6B= 107,6B= 107 →rgb(255, 107, 107) - #1E293B →
1E= 30,29= 41,3B= 59 →rgb(30, 41, 59)
In practice, use the Color Converter to switch between hex, RGB, HSL, CMYK, and OKLCH instantly without mental arithmetic.
When to Use rgb() vs. Hex vs. HSL
- Hex codes (
#3B82F6): Compact, universal, standard in design tools and design tokens. Best for static color values. rgb(): Useful when you need to reference individual channel values dynamically, or when integrating with systems that output numeric RGB values.hsl(): Easier for conceptual color manipulation (adjusting lightness or hue while keeping the other properties stable).oklch(): Best for systematic design systems and perceptually uniform color interpolation (animations, palette generation).
Opacity and Semi-Transparency
RGB with alpha is the standard approach for overlays, shadows, and semi-transparent surfaces:
/* Dark overlay for modal backdrop */
background-color: rgb(0 0 0 / 0.5);
/* Colored highlight */
background-color: rgb(59 130 246 / 0.1); /* Very light blue tint */
/* Frosted glass effect base */
background-color: rgb(255 255 255 / 0.15); /* White at 15% opacity */
For these use cases, using rgb() with alpha is often clearer than using a hex code with the alpha appended as two digits (e.g., #3B82F680), because the alpha value is more legible as a decimal or percentage.
Key Takeaways
- The RGB color model encodes color as three independent channels — red, green, and blue — that correspond to the three types of cone cells in human vision.
- RGB is an additive model: adding more light of all three channels together produces white; the complete absence of all three produces black.
- Each channel runs from 0 to 255 (256 values), representing 8 bits of precision, which is why standard color is called "24-bit color" (3 channels × 8 bits).
- Three channels at 256 values each gives exactly 256³ = 16,777,216 possible colors — the commonly cited 16.7 million figure.
- In CSS,
rgb()accepts comma-separated or space-separated integers (0–255) or percentages; an optional/followed by a value specifies the alpha channel, makingrgba()redundant in modern CSS. - Use the Color Converter to switch between hex, RGB, HSL, CMYK, and OKLCH — especially useful when working across design tools, code, and print workflows.
- For perceptually uniform color manipulation (gradients, animations, systematic palettes), prefer OKLCH over raw RGB, which is not perceptually uniform.