RGB Color Codes Chart

RGB Color Picker

Note: Click on the color picker to get the HEX code

RGB Color Space

RGB color space or RGB color system constructs all the colors from combinations of the Red, Green, and Blue colors. Each color channel uses 8 bits with integer values from 0 to 255, making 256 × 256 × 256 = 16,777,216 possible colors.

RGB ≡ Red, Green, Blue
Each pixel on an LED monitor displays colors by combining red, green, and blue LEDs. When a channel is set to 0, that LED is off; when set to 255, the LED is fully on. Values in between produce varying light intensity.

RGB Color Format & Calculation

RGB color codes are stored in 24 bits (bits 0..23):

RED[7:0]   = bits 16-23
GREEN[7:0] = bits 8-15
BLUE[7:0]  = bits 0-7
  

Calculation of the decimal integer from R, G, and B values:

Decimal = R × 256² + G × 256 + B
        = R × 65536 + G × 256 + B
  

Calculation of the hex code from R, G, and B values:

Hex = "#" + two-digit-hex(R) + two-digit-hex(G) + two-digit-hex(B)
  

RGB Color Table

This table shows common RGB colors with their name, R, G, B values, Hex code, Decimal value, and a short description.

Name R G B Hex Decimal Description
Red25500#FF000016711680Pure Red
Green02550#00FF0065280Pure Green
Blue00255#0000FF255Pure Blue
Black000#0000000No color, Black
White255255255#FFFFFF16777215White, all colors combined
Yellow2552550#FFFF0016776960Red + Green
Cyan0255255#00FFFF65535Green + Blue
Magenta2550255#FF00FF16711935Red + Blue

HSV Color Space

HSV (Hue, Saturation, Value) is an alternative way to represent colors.

Conversion from RGB to HSV helps in understanding and manipulating colors in a more intuitive way.

Understanding RGB Color Codes

RGB stands for Red, Green, Blue—the three primary colors of light. In digital systems, colors are represented as combinations of these three values, each ranging from 0 to 255. When all three are set to 0, you get black. When all are set to 255, you get white.

Structure of an RGB Code

An RGB color is written as: rgb(R, G, B) where R, G, and B are integers between 0 and 255.

  • Red: rgb(255, 0, 0)
  • Green: rgb(0, 255, 0)
  • Blue: rgb(0, 0, 255)

You can mix these values to create millions of colors.

Hexadecimal Representation

RGB colors can also be written in hexadecimal format as #RRGGBB, where each pair of digits represents the red, green, and blue values respectively. Example:

  • #FF0000 → Red
  • #00FF00 → Green
  • #0000FF → Blue
  • #FFFF00 → Yellow

Common RGB Color Codes

ColorRGBHex
Blackrgb(0, 0, 0)#000000
Whitergb(255, 255, 255)#FFFFFF
Redrgb(255, 0, 0)#FF0000
Greenrgb(0, 255, 0)#00FF00
Bluergb(0, 0, 255)#0000FF
Yellowrgb(255, 255, 0)#FFFF00
Cyanrgb(0, 255, 255)#00FFFF
Magentargb(255, 0, 255)#FF00FF

Use in Web Development

Web designers use RGB and Hex codes to style elements with specific colors in CSS:

    body {
      background-color: rgb(240, 240, 240);
      color: #333333;
    }
    

Visualizing Color Intensity

Each color channel (Red, Green, Blue) influences the final color’s brightness and hue. Example:

  • rgb(128, 0, 0) → Dark Red
  • rgb(128, 128, 0) → Olive
  • rgb(192, 192, 192) → Light Gray

Color Picker Tools

Designers and developers use digital color pickers to:

  • Select exact shades visually.
  • Copy RGB or Hex values to clipboard.
  • Preview how colors look on different backgrounds.

Accessibility and Contrast

Choosing the right color contrast ensures readability, especially for users with visual impairments. Tools like WCAG Contrast Checkers help validate:

  • Text over background combinations.
  • Compliance with accessibility standards.

Conversion Tools

Many tools help convert between RGB, Hex, and even HSL (Hue, Saturation, Lightness). Example conversion:

rgb(255, 0, 0)#FF0000hsl(0, 100%, 50%)

Advanced Uses of RGB

  • Data Visualization: RGB codes are used in graphs, heatmaps, and dashboards.
  • Image Processing: Each pixel’s color is represented by RGB values.
  • Game Development: Lighting, textures, and UI elements rely on accurate RGB coding.

Fun with Gradients

Using multiple RGB values, you can create gradients in CSS:

    background: linear-gradient(to right, rgb(255, 0, 0), rgb(0, 0, 255));
    

This will create a smooth red-to-blue gradient across the background.

Final analysis

RGB color codes are an essential part of digital design, development, and visualization. Whether you're building a website, designing an app, or manipulating images, understanding how to work with RGB and its representations helps you craft clear, beautiful, and user-friendly visuals.

See Also