What Is RGB? How To Create And Use It In Design?

Last Update:
June 8, 2026
what is rgb

RGB is the color model behind every screen you design for. It builds color from red, green, and blue light, with each channel running from 0 to 255, which together produce about 16.7 million colors.

That much you can find anywhere. What most guides skip is how those numbers behave once you are inside Figma, shipping a design system, or checking contrast before launch.

At Musemind, our team works with RGB every day across SaaS dashboards, mobile apps, and brand systems, and the same questions keep surfacing. This guide answers them in order: the scale, color profiles, accessibility, and the exact values professional teams rely on

Question Short Answer
What is RGB? A color model that builds on-screen color from red, green, and blue light. Full intensity on all three makes white, zero makes black.
What does the 0 to 255 scale mean? Each channel uses 8 bits, so it holds 256 levels. Three channels give about 16.7 million colors.
RGB or CMYK? RGB for anything on a screen. CMYK only for print.
Why do my colors shift on another screen? RGB is device-dependent. A profile such as sRGB or Display P3 defines what the numbers actually look like.
Does RGB affect accessibility? Yes. WCAG contrast ratios are calculated from RGB luminance, so the numbers decide whether text passes.

What Is RGB Color?

rgb additive color model

RGB stands for Red, Green, and Blue. It is the color model used by every digital display to produce color by combining light from three channels. Each channel is assigned a value between 0 (no light) and 255 (maximum intensity). By mixing these three channels at different intensities, screens can produce over 16.7 million distinct colors.

RGB is an additive color model, one of the core ideas in color theory: adding more light produces brighter, lighter results. At maximum intensity across all three channels, RGB(255, 255, 255) produces white. At zero intensity across all three, RGB(0, 0, 0) produces black.

This is the opposite of how paint or ink works. Mix all ink colors together and you get dark, muddy brown. Mix all RGB light channels at full intensity and you get pure white.

One detail trips up most designers: RGB is device-dependent. The triplet RGB(255, 0, 0) does not name one fixed red. It tells a screen to fire its red channel at full intensity, and every panel does that a little differently based on its hardware and its age.

Two monitors can open the same file and still not match. This is the reason color profiles exist, and it is why the same hex code can look punchy on one display and flat on another. We come back to profiles later. For now, hold onto the core idea: the numbers are instructions, not absolute colors.

How Does RGB Work? Additive Color Mixing

rgb screen subpixels closeup

When your monitor displays a color, it fires microscopic red, green, and blue subpixels at specific intensities. Your eye blends these light emissions into a single perceived color. This happens at a scale too small to see without magnification.

The mixing rules for RGB follow additive light physics:

Mix Result
Red + Green Yellow
Red + Blue Magenta
Green + Blue Cyan
Red + Green + Blue White
None (all zero) Black

This is why RGB is called additive: you are adding light wavelengths. The more you add, the closer you get to white.

The RGB Scale: What the Numbers 0 to 255 Actually Mean

Each of the three RGB channels accepts an integer from 0 to 255. This gives 256 possible values per channel. The reason for 256 steps, not 100 or 1000, is rooted in how computers store data: 8 bits can represent exactly 256 values (2 to the power of 8). Three 8-bit channels give 256 x 256 x 256 = 16,777,216 possible colors.

rgb channel values 0 to 255
Channel Value 0 Value 128 Value 255
Red No red Medium red Full red
Green No green Medium green Full green
Blue No blue Medium blue Full blue

In practice, the scale behaves differently for each channel. A green value of 200 looks brighter than a red value of 200 because human eyes are more sensitive to green light. This matters when you adjust colors by feel: equal numeric shifts do not produce visually equal changes.

Why RGB(128, 128, 128) Is Not Half as Bright

The 0 to 255 scale looks linear, but your screen does not treat it that way. Display values are gamma-encoded, which bends the signal to match how human vision handles brightness. We read fine detail in dark tones and less in bright ones, so the encoding gives darker values more room on the scale.

The practical effect: a channel set to 128 sits near the middle of the number range, but it renders at roughly 22 percent of full brightness on a standard display, not 50 percent.

This matters in two places. First, it explains why nudging a value by 10 near the dark end shifts the look more than the same nudge near the top. Second, it is the reason contrast math is not a plain subtraction of RGB numbers.

WCAG converts each gamma-encoded channel back to linear light, then weights the channels, before it produces a ratio. Those weights show up in the accessibility section. The takeaway: trust a contrast checker over the raw numbers, because the numbers hide the curve.

RGB Primary and Secondary Colors

These are the pure channel values every designer should recognize on sight. They map directly to the primary colors and secondary colors of light:

Color RGB Value Hex Code
Black RGB(0, 0, 0) #000000
White RGB(255, 255, 255) #FFFFFF
Red RGB(255, 0, 0) #FF0000
Green RGB(0, 255, 0) #00FF00
Blue RGB(0, 0, 255) #0000FF
Yellow RGB(255, 255, 0) #FFFF00
Cyan RGB(0, 255, 255) #00FFFF
Magenta RGB(255, 0, 255) #FF00FF
50% Gray RGB(128, 128, 128) #808080

Note that pure green in RGB, RGB(0, 255, 0), looks nearly neon. It is not the natural green you see in printed design.

Most design systems use a desaturated, adjusted green like RGB(52, 168, 83) or RGB(34, 139, 34) because pure RGB green is visually aggressive on screens.

RGB vs. CMYK: Which Should Designers Use?

The answer depends entirely on the output medium:

Factor RGB CMYK
Used for Screens, digital displays, web, apps. Print: brochures, books, packaging.
Color mixing Additive color mixing using light. Subtractive color mixing using ink.
Color range (gamut) Wider gamut; includes neons and vibrant digital colors. Narrower gamut; some RGB colors cannot be printed accurately.
Black representation RGB(0, 0, 0) K (Key) channel.
File formats PNG, JPG, WebP, SVG. PDF, TIFF for print.
Design tools Figma, Sketch, and XD default to RGB. InDesign and Illustrator use CMYK for print work.

The mistake designers make most often: exporting a design from Figma (RGB) to a print vendor and assuming the colors will match. Bright screen blues and neon greens frequently cannot be reproduced in ink.

If you design for both screen and print, design in RGB for the screen-first deliverable, and let your print vendor convert with a proper ICC profile.

In product and UI design, you will almost never need CMYK. Every screen-facing deliverable (web, app, social, digital advertising) uses RGB.

Where RGB Is Used in Digital Design

RGB is the underlying color model for:

  • Web and browser rendering: Every color you define in CSS is processed as RGB. Even color names like tomato or cornflowerblue resolve to specific RGB values in the browser.
  • Mobile apps: iOS and Android displays render all interface colors as RGB values. Design tokens store colors as RGB or hex, which is a compressed form of the same data.
  • Photography and video: Digital cameras capture RAW data in RGB channels. Standards like sRGB and Rec. 709 are RGB-based color spaces for display.
  • Digital advertising: Banner ads, social graphics, and all digital paid media are delivered and displayed as RGB assets.
  • Design systems: Color tokens in a design system store values as RGB or hex. A brand color token like --color-primary-500, the kind that anchors a brand identity design, is an RGB value.
  • Game and 3D design: Unity, Unreal, Blender, and every real-time 3D tool use RGB for material colors and lighting.

RGB in Web Design: CSS and Hex Codes

In CSS, you can define RGB colors in two ways.

RGB notation:

color: rgb(255, 87, 51);

Hex notation (compressed RGB):

color: #FF5733;

Hex code is just RGB expressed in base-16 (hexadecimal). #FF5733 breaks into:

FF = 255 (Red)

57 = 87  (Green)

33 = 51  (Blue)

RGBA adds opacity through an alpha channel:

background: rgba(255, 87, 51, 0.75);  /* 75% opacity */

The fourth value is the alpha channel. It sets opacity from 0 (fully transparent) to 1 (fully opaque), which is why the model is often written as RGBA when transparency is in play.

CSS also supports HSL, which many designers find more intuitive because you adjust Hue, Saturation, and Lightness rather than three light channels. Under the hood, the browser converts HSL to RGB for rendering.

Modern CSS color spaces: 

CSS reaches wider color through oklch() and the display-p3 color space. Browser support is broad. Safari shipped display-p3 first in 2020, and all major browsers reached wide-gamut color support in 2023.

color: color(display-p3 0.9 0.3 0.2);

This lets web designs reach the wider P3 gamut on capable displays instead of staying capped at sRGB.

RGB in Figma and Design Tools

rgb-color picker in design tools

In Figma, the color picker defaults to HEX, but you can switch the color mode dropdown to RGB, HSL, HSB, or CSS. For most design work, either HEX or RGB is fine. Switch to HSB when you want to adjust brightness without shifting the hue.

Practical tips for RGB in Figma:

  • When copying colors from a brand guide that specifies RGB values, use Figma's RGB mode to enter them exactly: R:67, G:97, B:238 rather than converting manually.
  • Figma color variables (design tokens) store colors as hex under the hood, which is RGB-compatible.
  • When exporting assets for web, Figma defaults to sRGB. If you target modern Apple displays or P3-capable screens, check whether your export workflow handles the color space correctly.
  • The eyedropper tool picks RGB values from anywhere on screen. Use it to extract colors from reference images or screenshots directly.

In Sketch: 

The color picker works identically. The Global Colors in Sketch's shared libraries store RGB hex values.

In Adobe Illustrator: 

Switch document color mode to RGB for all screen-facing work (File > Document Color Mode > RGB Color). Illustrator defaults to CMYK on a new document, which causes color-shift problems if you do not change it upfront.

Color Profiles: sRGB, Display P3, and Adobe RGB

This is the section most "what is rgb" guides skip, and it is the one that causes real problems in professional design work.

srgb display p3 adobe rgb gamut comparison

sRGB (standard RGB) is the default color space for the web. It was defined in 1996 for CRT monitors and has been the web standard ever since. When a browser displays a JPEG or PNG, it assumes sRGB unless the file has an embedded color profile. When Figma exports, it uses sRGB.

Display P3 is Apple's wide-gamut color space, used in iPhone, MacBook Pro, and iMac lines for years. It covers approximately 25 percent more colors than sRGB, specifically in the green and red ranges.

When you design a vibrant green button on a P3 display, it looks more saturated than it will on a standard sRGB monitor.

Adobe RGB covers a similarly wide gamut, shaped toward print colors, and you mostly see it in professional photography. For screen design, you rarely encounter it.

Profile Gamut Coverage Primary Use
sRGB Baseline, used as the 100% reference. Web and default screen design.
Display P3 About 25% wider than sRGB. Apple displays, modern Android devices, and wide-gamut screens.
Adobe RGB Similar overall size to Display P3, but with a different gamut shape. Photography and print preparation.

What this means for your design work:

If you design on a MacBook Pro with a P3 display and export to sRGB for web, some of your most vibrant colors will look slightly duller on sRGB-only screens. This is not a bug. It is a gamut-mapping limitation: some colors you can see on your P3 screen simply cannot be represented in sRGB.

The practical fix: when your design has very saturated colors (vivid greens, electric blues, neon oranges), check it on an sRGB-only screen before shipping. Windows displays and older monitors typically render in sRGB.

One more axis sits beneath the profile: bit depth. Standard screen design runs on 8 bits per channel, the 256 levels covered earlier. Modern HDR and many wide-gamut displays push to 10 bits per channel, which gives 1,024 levels and over a billion possible colors.

More levels reduce banding in gradients and smooth skies, and HDR needs that headroom to hold detail in very bright and very dark areas at once. For most UI work, 8-bit sRGB is still the right export target. The time to care about 10-bit is when you design HDR media or ship to displays built for it.

RGB and Accessibility: How Color Values Connect to WCAG Standards

rgb accessibility wcag contrast diagram

WCAG 2.1 contrast ratio requirements are calculated from RGB values. The formula uses relative luminance: a measure of how bright a color is when perceived by the human eye.

Luminance accounts for the fact that human eyes are more sensitive to green than to red or blue. The formula weights each channel differently:

  • Green contributes most to perceived brightness (weight 0.7152).
  • Red contributes significantly (weight 0.2126).
  • Blue contributes least (weight 0.0722).

This is why white text on a dark blue background often passes contrast requirements even though dark blue has substantial blue saturation. Blue's low luminance weight means it reads as dark regardless of its channel value.

WCAG AA minimums:

  • Normal text: contrast ratio 4.5:1
  • Large text (18pt and up): contrast ratio 3:1
  • UI components (buttons, icons): contrast ratio 3:1

WCAG AAA (enhanced):

  • Normal text: contrast ratio 7:1

In practice: do not guess at accessibility with RGB values. Use a contrast checker. Figma has a built-in checker in its Accessibility plugin, and the WebAIM Contrast Checker accepts hex or RGB input.

Common failure patterns:

  • Light gray text on white backgrounds. RGB(180, 180, 180) on RGB(255, 255, 255) fails AA at about 2.1:1.
  • Blue text on dark backgrounds can pass or fail depending on the specific blue.
  • Colored text on colored backgrounds requires actual calculation, not visual judgment.

Common RGB Color Values Every Designer Should Know

These values appear consistently in professional design systems. For building full palettes, see our guides on color palette types and choosing UI color.

Neutrals (text, backgrounds, and borders):

Color RGB Value Hex Code Use Case
Pure black RGB(0, 0, 0) #000000 Rarely used in UI; too harsh.
Near-black RGB(18, 18, 18) #121212 Material Design dark background.
Dark gray text RGB(33, 33, 33) #212121 Standard body text on white.
Medium gray RGB(117, 117, 117) #757575 Minimum AA contrast on white.
Light gray RGB(238, 238, 238) #EEEEEE Common background tint.
Off-white RGB(250, 250, 250) #FAFAFA Slightly warm white for backgrounds.
Pure white RGB(255, 255, 255) #FFFFFF Cards on off-white backgrounds.

Colors frequently used in UI:

Use RGB Value Hex Notes
Primary blue (Google) RGB(66, 133, 244) #4285F4 Recognizable brand reference.
Success green RGB(52, 168, 83) #34A853 Google green; widely adopted.
Warning yellow RGB(251, 188, 4) #FBBC04 High visibility; passes AA on dark backgrounds.
Error red RGB(234, 67, 53) #EA4335 Standard error state.
Accent purple RGB(162, 89, 255) #A259FF Vivid accent for highlights and CTAs.
Accessible link blue RGB(0, 84, 166) #0054A6 Passes AA on white.

How to Convert RGB to Hex

hexadecimal number from 00 to FF. For example, RGB(255, 87, 51) becomes #FF5733. Red 255 converts to FF, green 87 converts to 57, and blue 51 converts to 33. In real design work, you usually do not need to convert this manually because tools like Figma, Photoshop, and CSS editors handle it automatically.

Still, understanding the logic helps you see that Hex and RGB are just two different ways of writing the same color. For example, #FF5733 and rgb(255, 87, 51) represent the exact same color. CSS also supports shorthand Hex when both digits in each color channel match, such as #FFFFFF becoming #FFF, #000000 becoming #000, and #AABBCC becoming #ABC.

How To Convert RGB To CMYK?

To convert RGB to CMYK, you need to adjust the colors from an additive model (RGB) to a subtractive model (CMYK). Here’s a simple step-by-step guide to help you:

1. Normalize the RGB values

First, you must convert the RGB values between 0 and 255 into a range between 0 and 1. You can do this by dividing each RGB value by 255. For example, if your RGB is (255, 0, 0), you divide each by 255, resulting in (1, 0, 0).

2. Find the CMY values

Next, calculate the values for Cyan, Magenta, and Yellow. Use this formula:

  • C = 1 - R
  • M = 1 - G
  • Y = 1 - B
  • For example, with RGB(255, 0, 0), you’ll get C = 0, M = 1, Y = 1.

3. Calculate the K value

K, or Black, is determined by finding the minimum value between C, M, and Y. This helps to decide how much black ink is needed in the print. K = min(C, M, Y).

4. Adjust the CMY values

Now subtract K from each of the CMY values:

  • C = (C - K) / (1 - K)
  • M = (M - K) / (1 - K)
  • Y = (Y - K) / (1 - K)
  • This gives you the final CMYK values.

The above simple process helps you effectively convert digital colors from screen to print!

Frequently Asked Questions

What is the difference between RGB and HEX?

They represent the same color model in different notation. RGB(255, 87, 51) and #FF5733 are identical colors. Hex is just RGB values expressed in base-16. Design tools convert between them automatically.

Use whichever your workflow needs: hex for CSS and most design tools, RGB when entering values manually or working with token systems that store numeric channels.

Why does RGB go from 0 to 255 and not 0 to 100?

The range comes from binary storage. One byte (8 bits) stores exactly 256 values (0 through 255). Three bytes for three channels give 256 x 256 x 256 = 16,777,216 possible colors. This is also why RGB is sometimes called 24-bit color (8 bits per channel times 3 channels).

What is the difference between RGB and HSL?

Both describe color in different terms. RGB defines color as amounts of red, green, and blue light. HSL defines it as Hue (position on the spectrum, 0 to 360 degrees), Saturation (intensity, 0 to 100%), and Lightness (brightness, 0 to 100%).

HSL is more intuitive for adjustments: raise Lightness to lighten, lower Saturation to mute. CSS supports both, and HSL is converted to RGB for rendering.

Can RGB colors be used in print?

RGB works as a starting point, but print requires CMYK. The RGB gamut is larger than CMYK inks can reproduce, so bright neons, electric blues, and vivid greens often look duller in print because the matching ink mix does not exist. For print work, use your printer's ICC profile to preview how RGB colors will translate.

What RGB value should I use for black text on a white background?

Pure black RGB(0, 0, 0) on RGB(255, 255, 255) gives a 21:1 contrast ratio, well past WCAG AA (4.5:1) and AAA (7:1). Many design systems use near-black such as RGB(33, 33, 33) or RGB(18, 18, 18) for a softer feel while still passing AA and AAA comfortably.

What is sRGB and do I need to worry about it?

sRGB is the default color space for the web and most screen design. It defines what specific RGB values look like in real-world terms.

On a wide-gamut P3 display, colors can look more saturated than they will on sRGB-only screens. For most web and app work, export in sRGB unless you have a specific reason to use a wider space.

What is the best RGB color for a website background?

Pure white can feel harsh, so most designs use a slight off-white for large areas: RGB(250, 250, 250), RGB(245, 245, 245), or a warm RGB(254, 252, 248).

For dark mode, Material Design recommends RGB(18, 18, 18) over pure black, which reduces eye strain and allows surface elevation through subtle lightness changes.

Putting RGB to Work

RGB is not just a technical spec. It is the operating language of every interface you design. The 0 to 255 scale, how hex maps to channels, how sRGB and P3 profiles change what clients see on different screens, and how luminance values decide accessibility: these are the practical dimensions that separate designers who work confidently with color from those who guess and adjust until it looks right.

The tools handle most of the conversion. What they cannot do is tell you when a profile mismatch will dull your brand colors on a client's Windows laptop, or whether your gray text passes WCAG AA on the background you chose. That judgment comes from understanding what the numbers mean.

Nasir Uddin
Nasir Uddin
CEO at musemind
I’m on a mission to systemize creativity while embracing the journey of continuous learning. Passionate about everything design and creativity, I believe great design is in service of people with a focus on improving our collective future.
UI UX design Inspiration right in your inbox
By entering your email, you are agreeing to our privacy policy.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
No items found.
Find The Right Design Services for You!