Copied to clipboard!
Real Colour Picker
Real Colour
Hexadecimal to Decimals · CSS Color Level 4
Need Reverse? RGB to HEX →

HEX to RGB Color Converter

Convert any 3-digit, 6-digit, or 8-digit HEX code into Red, Green, Blue decimal components (0–255) and alpha opacity in real-time.

Supports #RGB, #RGBA, #RRGGBB, #RRGGBBAA
#
Red Channel59#3B · 23.1%
Green Channel130#82 · 51.0%
Blue Channel246#F6 · 96.5%
Alpha (Opacity)100%#FF · 255/255
View Harmonies in Wheel→
Popular Presets:Click any shade to test
RGB Output
Royal Blue
rgb(59, 130, 246)#3B82F6
vs White: 3.68:1 (AA Lg)vs Black: 5.71:1 (AAA)

Color Code Conversion Table

Equivalent values across web standards, CSS Color Level 4, and application models.

Real-Time Sync
Color Code Multi-Format Conversion Reference Table
Color SpaceRaw ValueSyntax / Value StringActions
HEX#3B82F6#3B82F6
RGB59, 130, 246rgb(59, 130, 246)
HSL217°, 91%, 60%hsl(217deg 91% 60%)
HWBCSS 4
217°, 23%, 4%hwb(217deg 23% 4%)
HSVApp / Print Format
217°, 76%, 96%hsv(217, 76%, 96%)
OKLCH0.62, 0.19, 254oklch(0.62 0.19 254)
CMYKApp / Print Format
76%, 47%, 0%, 4%cmyk(76%, 47%, 0%, 4%)

HEX to RGB Decimal Calculation:

Base-16 positional logic

Common HEX to RGB Conversions

Quick reference table for standard web colors. Click "Load" to test any shade in the converter above.

20 Core Web Standards
ColorNameHEX CodeRGB (R, G, B)HSLActions
White#FFFFFFrgb(255, 255, 255)0°, 0%, 100%
Black#000000rgb(0, 0, 0)0°, 0%, 0%
Red#FF0000rgb(255, 0, 0)0°, 100%, 50%
Lime#00FF00rgb(0, 255, 0)120°, 100%, 50%
Blue#0000FFrgb(0, 0, 255)240°, 100%, 50%
Yellow#FFFF00rgb(255, 255, 0)60°, 100%, 50%
Cyan / Aqua#00FFFFrgb(0, 255, 255)180°, 100%, 50%
Magenta / Fuchsia#FF00FFrgb(255, 0, 255)300°, 100%, 50%
Silver#C0C0C0rgb(192, 192, 192)0°, 0%, 75%
Gray#808080rgb(128, 128, 128)0°, 0%, 50%
Purple#800080rgb(128, 0, 128)300°, 100%, 25%
Teal#008080rgb(0, 128, 128)180°, 100%, 25%
Orange#FFA500rgb(255, 165, 0)39°, 100%, 50%
Maroon#800000rgb(128, 0, 0)0°, 100%, 25%
Navy#000080rgb(0, 0, 128)240°, 100%, 25%
Royal Blue#4169E1rgb(65, 105, 225)225°, 73%, 57%
Emerald#10B981rgb(16, 185, 129)160°, 84%, 39%
Indigo#6366F1rgb(99, 102, 241)239°, 84%, 67%
Coral#FF7F50rgb(255, 127, 80)16°, 100%, 66%
Gold#FFD700rgb(255, 215, 0)51°, 100%, 50%
#RRGGBBAA Suffix Cheat SheetCSS Color Level 4

HEX Opacity & Alpha Channel Reference

Quick reference lookup mapping opacity percentages to their 2-digit Hexadecimal alpha suffixes. Click "Set" to test any opacity on the live converter above.

Formula: Math.round(Pct% × 255) → Hex
100%#FF
255/255
95%#F2
242/255
90%#E6
230/255
85%#D9
217/255
80%#CC
204/255
75%#BF
191/255
70%#B3
179/255
60%#99
153/255
50%#80
128/255
40%#66
102/255
30%#4D
77/255
25%#40
64/255
20%#33
51/255
10%#1A
26/255
5%#0D
13/255
0%#00
0/255
Computer Science Fundamentals

Understanding Base-16 Positional Math & Alpha Suffixes

Hexadecimal is a base-16 positional numeral system. An 8-bit byte holds values from 0 to 255 (2⁸ = 256 possible states), which maps precisely onto two hexadecimal characters (16 × 16 = 256).

Step 1: Decimal Normalization (Channel × 255)

For opacity percentages (e.g. 80%), multiply by 255 and round to the nearest integer:

0.80 × 255 = 204

Step 2: Division by 16 (High-order quotient & low-order remainder)

Divide decimal by 16 to extract the high-order quotient and low-order remainder:

204 ÷ 16 = 12 (rem: 12)

Step 3: Hex Digit Substitution (Base-16 character mapping)

Map 0–15 to base-16 digits (10=A … 12=C):

12 & 12 → "CC" (#CC)

Shorthand Expansion Rules:

CSS Color specifications permit concise 3-digit and 4-digit hexadecimal shorthand by duplicating each individual character into an identical 2-digit nibble pair:

  • 3-digit Hex #369 → #336699
  • 4-digit Hex #369C → #336699CC (80% alpha)
Base-16 Color Engineering & Decimal Conversion Standards

The Ultimate HEX to RGB Converter: Hexadecimal to Decimal Engineering Guide

The hex to rgb converter on Real Colour Picker transforms base-16 strings into precise decimal color channels instantly. Serving as an accurate hex to rgb utility, convert hex to rgb tool, hex code to rgb translator, and color hex to rgb engine, our studio bridges the gap between concise web stylesheets and physical hardware framebuffers.

Whether you are styling user interfaces or learning how to convert hex to rgb, this platform provides real-time hex to rgb conversion and channel inspection. Acting as a dedicated color converter hex to rgb, hex code to rgb converter, and hex to rgb calculator, our suite helps you convert hex code to rgb, inspect every hexadecimal to rgb color, show color from hex code, and convert hex to rgb and cmyk for print preparation.

Hex to RGB Formula: Decimal Math & Positional Notation

The mathematical Hex to RGB formula relies on base-16 positional numeral notation. In digital colorimetry, the hex color code range for each primary channel spans from 00 (decimal 0) to FF (decimal 255), representing 256 discrete levels per channel ($16 \times 16 = 256$).

Our hex to rgb mathematical conversion formula online breaks down how to read hex color code values in decimal online in three stages:

  1. Split Channel Pairs: Isolate the 6-digit hex string into Red ($R_1 R_2$), Green ($G_1 G_2$), and Blue ($B_1 B_2$) byte pairs.
  2. High-Order Multiplication: Multiply the first character's base-16 decimal value by 16 ($D_1 \times 16^1$).
  3. Low-Order Addition: Add the second character's value ($D_2 \times 16^0$) to obtain the channel decimal ($D_1 \times 16 + D_2$).
Positional Math Example: Converting #3B82F6 to RGB
Red (3B): (3 × 16) + 11 = 59
Green (82): (8 × 16) + 2 = 130 | Blue (F6): (15 × 16) + 6 = 246
Result: rgb(59, 130, 246)

To parse values inside data spreadsheets, analysts use a Hex to rgb mathematical conversion formula excel solution: =HEX2DEC(MID(A1,2,2)) for Red, =HEX2DEC(MID(A1,4,2)) for Green, and =HEX2DEC(MID(A1,6,2)) for Blue. When calculating Hex to RGB percentage, divide each channel by 255 (e.g. rgb(23.1%, 51%, 96.5%)). This exact hexadecimal to rgb calculation pairs directly with our reverse RGB to hex formula.

Hexadecimal Color Code Formats: Shorthand, Alpha & Normalized Floats

Understanding standard hex color code format specifications is critical for interface engineering. A valid hexadecimal color code appears in 3-digit shorthand, standard 6-digit TrueColor, or modern 8-digit alpha notation.

Parsing rules and specifications across modern stylesheet engines:

  • 3-Digit Hex Color Code Expansion: For concise markup, shorthand 3 digit hex code expansion to rgb css, shorthand 3 digit hex code expansion to rgb html, and shorthand 3 digit hex code expansion to rgb online duplicates each digit into identical pairs (#FA3 expands to #FFAA33 → rgb(255, 170, 51)).
  • Hex to RGBA & Alpha Transparency: When you convert hex with transparency to rgba online or convert hex with transparency to rgba online free, 8-digit hex adds a two-character alpha suffix (#RRGGBBAA). For instance, #3B82F680 (alpha 80 ≈ 128 / 255) generates rgba(59, 130, 246, 0.502).
  • HEX to Normalized RGB & Floats: WebGL, GLSL shaders, Three.js, and Metal require HEX to RGBA float and Hex to RGBA 0 1 values normalized between 0.0 and 1.0 ($C / 255$).
  • Convert RGBA to Hex Without Opacity: In legacy contexts lacking alpha, blend foreground channels against background white using alpha-compositing before converting RGBA to HEX.

Using our interactive RGBA color picker, you can convert between RGBA to 8 digit hex and generate certified tokens with convert 8 digit hex code to rgba css online capabilities.

Programmatic Algorithms: Python, JavaScript & CSS Variables

Developers often need to convert hex to rgb python scripts or run convert hex to rgb javascript modules within automated asset pipelines. Here is how to read hex color code values in decimal python and how to read hex color code values in decimal javascript accurately:

Python hex to RGB (Python convert hex to rgb):def hex_to_rgb(hex_code: str) -> tuple[int, int, int]:
    h = hex_code.lstrip('#')
    if len(h) == 3: h = ''.join(c * 2 for c in h)
    return tuple(int(h[i:i+2], 16) for i in (0, 2, 4))
Convert 8 digit hex code to rgba css javascript:function hexToRgba(hex) {
  let c = hex.replace('#', '');
  if (c.length === 3 || c.length === 4) c = [...c].map(x => x + x).join('');
  const num = parseInt(c, 16);
  const a = c.length === 8 ? Number(((num & 255) / 255).toFixed(3)) : 1.0;
  const shift = c.length === 8 ? 8 : 0;
  return `rgba(${(num >> (16 + shift)) & 255}, ${(num >> (8 + shift)) & 255}, ${(num >> shift) & 255}, ${a})`;
}

When applying an rgb to hex converter for css variables online following rgb to hex converter for css variables w3schools recommendations, separating channels allows dynamic opacity with CSS RGB to hex compatibility:

:root { --color-primary-rgb: 59, 130, 246; }
.btn { background-color: rgb(var(--color-primary-rgb) / 0.85); }

This architecture works bi-directionally alongside an RGB to hex converter Python script using our integrated hex to rgb mathematical conversion formula python.

Multi-Space Colorimetry: HEX to RGB and CMYK for Print & Digital

Screens and printers use opposing color science. Web graphics use additive RGB light, while commercial presses rely on subtractive CMYK inks.

  • Hex to RGB and CMYK Translation: When translating screen hex codes to four-color ink processes, RGB values are normalized ($R'=R/255$, $G'=G/255$, $B'=B/255$) to derive Key black ($K = 1 - \max(R',G',B')$) and Cyan, Magenta, Yellow values.
  • Studio vs. Basic Search Tools: While basic search queries like Hex to RGB Google provide static chips, Real Colour Picker delivers a complete engineering workstation with 3-digit expansion, 8-digit alpha handling, WCAG 2.2 contrast checks, and token export.
  • Wide-Gamut Spaces: Web hex codes map to standard sRGB (IEC 61966-2-1). For wide-gamut workflows like Display P3 or Adobe RGB to HEX, gamut remapping preserves intended tone fidelity across devices.

Every calculated hex to rgb color is verified in real time, making our studio an indispensable companion for design system engineers.

Step-by-Step: How to Convert Hexadecimal Color Codes to RGB Online

Follow this 5-step workflow to convert any hex code, parse opacity transparency, inspect channel values, and export certified design tokens.

1

Input Hex Code

Enter any 3-digit (#RGB), 6-digit (#RRGGBB), or 8-digit (#RRGGBBAA) hexadecimal color code with or without the hash symbol.

2

Automatic Expansion

The parser detects shorthand formats and automatically doubles each digit to evaluate full 24-bit TrueColor components.

3

Inspect RGB & Alpha

View real-time decimal Red, Green, and Blue values (0–255), percentage channels, and alpha transparency (0.0–1.0).

4

Review Multi-Format

Check simultaneous conversions to CMYK for print, HSL/HSV for color harmony, and OKLCH for CSS Color Level 4 perceptual uniformity.

5

Export Tokens

Copy clean rgb() or rgba() CSS syntax in one click, or export design tokens directly to Tailwind CSS and CSS variables.

HEX to RGB, Opacity & CMYK FAQs

Frequently Asked Questions

Comprehensive answers on converting hexadecimal color codes to decimal RGB triplets, alpha opacity formulas, base-16 math breakdowns, and RGB vs. CMYK print specifications.

28 Answers
01

How do I convert hex code to RGB code?

To convert a 6-digit hexadecimal color code (#RRGGBB) to decimal RGB values, extract each two-character channel pair and convert it from base-16 to base-10 decimal:

  1. Split into three pairs: Separate the code into Red (RR), Green (GG), and Blue (BB) components. For shorthand 3-digit hex (#RGB), duplicate each digit first (#2C7 → #22CC77).
  2. Apply the base-16 formula: For each pair (D1, D2), multiply the first digit by 16 and add the second digit:
    Decimal Channel = (Digit_1 × 16) + Digit_2
    Substitute letters: A=10, B=11, C=12, D=13, E=14, F=15.
  3. Worked Example for Emerald Green (#2ECC71):
    • Red (2E): (2 × 16) + 14 = 32 + 14 = 46
    • Green (CC): (12 × 16) + 12 = 192 + 12 = 204
    • Blue (71): (7 × 16) + 1 = 112 + 1 = 113
  4. Assemble: Combining the three channels produces rgb(46, 204, 113).
02

How to calculate hex code from RGB?

To calculate a hexadecimal color code from decimal RGB channels (0–255), perform integer division and modulus remainders by 16 on each channel:

  1. Find High Digit (Quotient): Divide channel by 16: Quotient = Math.floor(Channel / 16).
  2. Find Low Digit (Remainder): Calculate modulus: Remainder = Channel % 16.
  3. Map Values > 9 to Letters: Convert 10→A, 11→B, 12→C, 13→D, 14→E, 15→F.
  4. Concatenate: Prefix with a hash symbol: #RRGGBB.

Example: For rgb(46, 204, 113): Red 46 → 46/16 = 2 rem 14 (E) → 2E; Green 204 → 204/16 = 12 (C) rem 12 (C) → CC; Blue 113 → 113/16 = 7 rem 1 → 71 → yields #2ECC71.

03

How do I convert hex code to decimal?

Hexadecimal is a base-16 positional number system. To convert any hex string to decimal, multiply each digit by 16 raised to its position exponent (counting from right to left, starting at power 0):

Decimal = ∑ (Digit_i × 16^i)
  • Digit Substitutions: Numbers 0–9 keep their values. Letters represent values 10 through 15: A=10, B=11, C=12, D=13, E=14, F=15.
  • Example 1 (Two-Digit Color Byte 3B):
    (3 × 16^1) + (11 × 16^0) = 48 + 11 = 59.
  • Example 2 (Two-Digit Color Byte FF):
    (15 × 16^1) + (15 × 16^0) = 240 + 15 = 255.
  • In Code: In JavaScript use parseInt("3B", 16); in Python use int("3B", 16).
04

What is a 6 digit hex color code?

A 6-digit hex color code follows the standard notation #RRGGBB:

  • Leading Hash (#): Indicates a hexadecimal color literal in HTML, CSS, SVG, and design tools.
  • Red Byte (RR): First two base-16 digits controlling the Red channel (from 00 [0] to FF [255]).
  • Green Byte (GG): Middle two digits controlling the Green channel.
  • Blue Byte (BB): Last two digits controlling the Blue channel.

Because each 2-digit pair yields 256 intensity states ($16 imes 16$), a 6-digit hex code can represent 256 × 256 × 256 = 16,777,216 unique 24-bit TrueColor hues, ranging from pitch black (#000000) to pure white (#FFFFFF).

05

What is #0000FF in RGB?

#0000FF in RGB is rgb(0, 0, 255).

  • Red Channel (00): Decimal 0 (0% intensity).
  • Green Channel (00): Decimal 0 (0% intensity).
  • Blue Channel (FF): Decimal 255 (15 × 16 + 15 = 255 — 100% full intensity).

This represents pure additive primary blue. In cylindrical HSL, it evaluates to hsl(240deg, 100%, 50%), with a low relative luminance of Y = 0.0722.

06

What color is RGB FFFFFF?

FFFFFF (written as hex code #FFFFFF or RGB rgb(255, 255, 255)) is pure white.

  • In the additive RGB color model, color is generated by emitting light. Pure white occurs when all three primary color channels (Red, Green, Blue) radiate at full maximum intensity (255 out of 255 or 100%).
  • Its relative luminance is 1.0 (the maximum possible on digital monitors), and its Light Reflectance Value (LRV) is 100%.
07

What is the formula for calculating opacity?

To calculate the 2-digit hexadecimal alpha byte (AA) from a percentage opacity value ($P in [0, 100]$):

AlphaByte = Math.round((Percentage / 100) × 255)
HexSuffix = AlphaByte.toString(16).padStart(2, '0').toUpperCase()

To reverse the calculation (converting a 2-digit hex alpha suffix back to percentage opacity):

Percentage = Math.round((parseInt(HexSuffix, 16) / 255) × 100)

For example, 75% opacity converts to Math.round(0.75 × 255) = 191 → BF.

08

What is the hex value for 20% opacity?

The 2-digit hexadecimal value for 20% opacity is 33.

  • Calculation: 0.20 × 255 = 51. In base-16: 51 / 16 = 3 with a remainder of 3 → yielding 33.
  • CSS Usage: Appending 33 to a hex code applies 20% opacity: e.g. #00000033 (equivalent to rgba(0, 0, 0, 0.2)).
09

What is 80% opacity in hex?

The 2-digit hexadecimal suffix for 80% opacity is CC.

  • Calculation: 0.80 × 255 = 204. In base-16: 204 / 16 = 12 (C) with a remainder of 12 (C) → yielding CC.
  • CSS Example: Pure white at 80% opacity is written as #FFFFFFCC (equivalent to rgba(255, 255, 255, 0.8)).
10

What is the hex code for 50% opacity?

The 2-digit hexadecimal code for 50% opacity is 80.

  • Calculation: 0.50 × 255 = 127.5 ≈ 128. In base-16: 128 / 16 = 8 with a remainder of 0 → yielding 80.
  • CSS Example: Pure blue at 50% transparency is written as #0000FF80 (equivalent to rgba(0, 0, 255, 0.5)).
11

What is percent opacity?

Percent opacity is a scalar metric from 0% to 100% that describes how completely an object, layer, or color blocks light from showing through behind it:

  • 100% Opacity: Completely solid and opaque. 0% of the underlying background shines through.
  • 50% Opacity: Semi-translucent. Equal optical blend between the foreground color and background surface.
  • 0% Opacity: Completely transparent and invisible. 100% of the underlying background shows through.

In CSS and digital design systems, percent opacity corresponds to the Alpha channel ($alpha$), normalized either from 0.0 to 1.0 in code or serialized as the last two hex digits (00 to FF) in 8-digit hexadecimal notation (#RRGGBBAA).

12

How do you measure opacity?

Opacity is measured differently across optical science and software engineering:

  • In Physical Optics & Material Science: Measured using spectrophotometers or densitometers as the ratio of incident light to transmitted light:
    Opacity (O) = 1 / Transmittance (T) = Incident Light (I0) / Transmitted Light (I)
  • In Digital Graphics & Display Hardware: Measured via an 8-bit Alpha channel quantized from 0 (transparent) to 255 (opaque), or as a normalized float ($0.0 le alpha le 1.0$).
  • Alpha Compositing (Porter-Duff): Display engines determine final pixel appearance by evaluating:
    Output_Pixel = (Foreground × α) + (Background × (1 - α))
13

What is the difference between RGB and CMYK color modes?

RGB and CMYK represent two fundamentally opposite physical methods of generating color:

  • RGB (Additive Light Synthesis — Screens & Displays):
    • Primaries: Red, Green, and Blue light.
    • Medium: Computer screens, smartphone OLEDs, TVs, digital cameras, and projectors.
    • Mechanism: Starts in total darkness (black screen). Adding light wavelengths increases luminance until combining all three at 100% creates pure white (rgb(255, 255, 255)).
    • Gamut: Wide color gamut capable of rendering vivid neons, bright cyans, and rich saturated primaries.
  • CMYK (Subtractive Pigment Synthesis — Physical Print):
    • Primaries: Cyan, Magenta, Yellow, and Key (Black) inks.
    • Medium: Paper, offset printing presses, packaging, and commercial brochures.
    • Mechanism: Starts on a white paper canvas. Physical ink pigments absorb (subtract) specific wavelengths of ambient light.
    • Gamut: Significantly narrower color gamut than RGB. Cannot physically reproduce electric or neon shades.
14

Why do we print in CMYK instead of RGB?

We print in CMYK because paper does not emit light; it only reflects ambient light:

  • Subtractive Physics: Because printing inks are translucent dyes, they work subtractively by filtering reflected white light:
    • Cyan ink: Absorbs (subtracts) red light and reflects green and blue.
    • Magenta ink: Absorbs green light and reflects red and blue.
    • Yellow ink: Absorbs blue light and reflects red and green.
  • Why "RGB Inks" Would Fail: If you attempted to print with Red, Green, and Blue inks onto white paper, each ink would subtract two-thirds of the spectrum. Combining them would quickly create a dark muddy brown, making it physically impossible to produce bright yellow, cyan, or light tones.
  • The Role of Key (Black): In theory, combining 100% Cyan, Magenta, and Yellow produces black. In reality, ink impurities result in a muddy dark brown. Adding a dedicated Key (Black) ink plate delivers deep rich blacks, sharp typography, and reduces ink costs and drying times.
15

What is better for screen, RGB or CMYK?

RGB is strictly better and the only native color mode for screens.

  • Computer monitors, phones, and televisions are physically built from microscopic Red, Green, and Blue sub-pixel light emitters.
  • CMYK is designed solely for physical ink mixing. When a CMYK file is opened on a digital screen, your operating system must emulate paper ink reflection, compressing colors into CMYK's narrower color gamut. This causes bright web accents to appear dull, muddy, and washed-out.
  • Always design in RGB (sRGB or Display P3) for web interfaces, mobile apps, digital videos, and software icons.
16

Which format is best for printing, RGB or CMYK?

The best format depends on the specific printing equipment and reproduction workflow:

  • Commercial Offset Presses & Packaging: CMYK is mandatory. Commercial 4-color printing presses require separated plates for Cyan, Magenta, Yellow, and Black (using standard calibrated profiles such as SWOP, GRACoL, or Fogra39).
  • Modern Fine Art & Photo Giclée Printers (Inkjet): High-bit RGB (Adobe RGB or ProPhoto RGB) is generally preferred. Professional photo printers use 6, 8, 10, or 12 ink cartridges (including Light Cyan, Light Magenta, Orange, Green, and Violet). Supplying wide-gamut RGB allows the printer's onboard Raster Image Processor (RIP) to access its full expanded gamut rather than being constrained by standard 4-color CMYK boundaries.
17

Do printers automatically convert RGB to CMYK?

Yes, consumer desktop printers and commercial Raster Image Processors (RIPs) automatically convert RGB files to CMYK. However, relying on automatic conversion often leads to undesirable color shifts:

  • Out-of-Gamut Clipping: Saturated RGB colors (such as electric blue #0000FF or neon lime #00FF00) fall far outside the printable CMYK color space.
  • Gamut Compression Shift: When a printer driver forces out-of-gamut RGB colors into CMYK, electric blues frequently turn into dull purples, and vibrant greens turn into olive drab.
  • Best Practice: Always convert your color palette to CMYK manually in your design software using your print vendor's target ICC color profile, and review a digital "soft-proof" before sending jobs to production.
18

What is the RGB value for #fffff?

#fffff (with 5 characters) is an invalid hex code. Valid hexadecimal color codes in web specifications require either 3, 4, 6, or 8 characters:

  • 6-Digit Valid Code (#ffffff): Evaluates to pure white: rgb(255, 255, 255).
  • 3-Digit Shorthand (#fff): Automatically expands to #ffffff → rgb(255, 255, 255).
  • 8-Digit Code with Alpha (#ffffffff): 100% opaque white → rgba(255, 255, 255, 1).

If #fffff is entered in CSS, browsers reject it as a syntax error. Ensure you provide the full 6 characters (#ffffff) to achieve pure white.

19

What is the hex code for RGB?

The hexadecimal codes for the pure primary and secondary colors in the RGB color model are:

  • Red: #FF0000 (rgb(255, 0, 0))
  • Green (Lime): #00FF00 (rgb(0, 255, 0))
  • Blue: #0000FF (rgb(0, 0, 255))
  • Yellow (Red + Green): #FFFF00
  • Cyan (Green + Blue): #00FFFF
  • Magenta (Red + Blue): #FF00FF
20

What is an 8-digit hex color code?

An 8-digit hex color code follows the format #RRGGBBAA specified in W3C CSS Color Module Level 4:

  • The first six characters (RRGGBB) specify Red, Green, and Blue decimal channels (0–255).
  • The final two characters (AA) specify the Alpha opacity channel from 00 (0% fully transparent) to FF (100% fully opaque).
  • Example: #3B82F680 represents brand blue (#3B82F6) at exactly 50% opacity (80).
  • Supported natively across all modern evergreen browsers (Chrome, Safari, Firefox, Edge).
21

How do I convert hex to RGBA in CSS?

You can convert a hex code to RGBA in CSS stylesheets using several modern approaches:

  • 1. Direct 8-Digit Hex (#RRGGBBAA): Append an alpha byte directly to your hex code without converting channels: .card { background-color: #3b82f680; /* 50% opacity */ }
  • 2. Native CSS color-mix(): Mix the hex code with transparent in sRGB: .card { background-color: color-mix(in srgb, #3b82f6 50%, transparent); }
  • 3. Standard rgb(r g b / a) Functional Notation: Translate the hex bytes to decimal (#3b82f6 → 59 130 246) and specify alpha: .card { background-color: rgb(59 130 246 / 0.5); }
22

How to give rgba color in CSS?

In CSS, you can apply an RGBA color across any color property (e.g. background-color, color, border-color) using either modern or legacy functional syntax:

  • Modern Space-and-Slash Syntax (CSS Color 4): .overlay { background-color: rgb(17 17 17 / 0.75); }
    /* Percentage alpha is also valid: */
    .overlay { background-color: rgb(17 17 17 / 75%); }
  • Legacy Comma-Separated Syntax: .overlay { background-color: rgba(17, 17, 17, 0.75); }
  • Why RGBA Beats opacity: 0.75: Setting opacity makes the entire element—including child text, icons, and buttons—translucent. Applying an RGBA background color keeps child content 100% crisp and readable.
23

What is #ffffff in decimal?

The 24-bit decimal integer value of #ffffff is 16,777,215.

  • Calculation:
    Decimal = (Red × 65536) + (Green × 256) + Blue
    (255 × 65536) + (255 × 256) + 255 = 16,711,680 + 65,280 + 255 = 16,777,215
  • In binary representation, this equals 24 consecutive ones ($2^{24} - 1$). It is the maximum unsigned value that can be stored in a 24-bit TrueColor image buffer.
24

What is 255 hex in decimal?

The interpretation depends on whether "255" refers to a hexadecimal string or a decimal value:

  • 1. If evaluating hexadecimal 0x255 into decimal:
    Applying base-16 positional powers:
    (2 × 16^2) + (5 × 16^1) + (5 × 16^0) = (2 × 256) + (5 × 16) + (5 × 1) = 512 + 80 + 5 = 597
    So, hex 0x255 equals decimal 597.
  • 2. If converting decimal 255 into hexadecimal:
    Decimal 255 converts to FF (0xFF), which represents the maximum intensity (100%) for an 8-bit RGB color channel.
25

What is 11111111 in hexadecimal?

The number 11111111 has two distinct interpretations:

  • 1. As an 8-Bit Binary Byte (Base-2: 11111111_2):
    In computer science, eight binary ones represent decimal 255 ($2^8 - 1$). In hexadecimal, this evaluates to FF (or 0xFF). In RGB colors, FF represents full 100% saturation on any channel.
  • 2. As a Base-10 Decimal Number (11,111,111):
    The integer eleven million, one hundred eleven thousand, one hundred eleven converts to A98AC7 in hexadecimal ($10 imes 16^5 + 9 imes 16^4 + 8 imes 16^3 + 10 imes 16^2 + 12 imes 16^1 + 7 imes 16^0$). In CSS, #A98AC7 produces a delicate pastel lavender.
26

What is 1024 hexadecimal in decimal?

The hexadecimal value 0x1024 in decimal is 4,132.

  • Calculation:
    (1 × 16^3) + (0 × 16^2) + (2 × 16^1) + (4 × 16^0)
    = (1 × 4096) + 0 + (2 × 16) + (4 × 1)
    = 4096 + 0 + 32 + 4 = 4,132
  • Note on Binary Kilobytes: Conversely, if you have decimal 1024 (equal to $2^{10}$, common in buffer sizes and memory allocation), converting decimal 1024 into hexadecimal yields 0x400 ($4 imes 16^2 = 1024$).
27

How is RGB calculated?

RGB is calculated using an additive color synthesis model based on human retinal biology. Our eyes have three types of cone photoreceptors sensitive to Short (Blue ~420nm), Medium (Green ~530nm), and Long (Red ~560nm) light wavelengths.

  • Channel Quantization: In digital displays (sRGB), each primary channel is stored as an 8-bit integer ($2^8 = 256$ discrete levels, from 0 to 255):
    • 0: Subpixel is off (0% light emission).
    • 255: Subpixel is at peak brightness (100% light emission).
  • Calculating from Percentage: When converting percentage intensity (0% to 100%) to an integer channel value:
    Channel = Math.round((Percentage / 100) × 255)
  • Combinations: Combining three 8-bit channels yields 256 × 256 × 256 = 16,777,216 distinct 24-bit TrueColor hues.
28

How do I read hex color codes?

You can read and estimate any 6-digit hex color code (#RRGGBB) at a glance using three visual heuristics:

  1. Identify the Dominant Hue: Compare the three pairs (RR, GG, BB). The channel with the highest alphanumeric value indicates the core hue. E.g. in #2ECC71, Green (CC ≈ 204) dominates over Red (2E ≈ 46) and Blue (71 ≈ 113), meaning the color is an emerald green.
  2. Gauge Overall Lightness: If the character values are generally high (letters D, E, F or high numbers like 8, 9), the color is bright or pastel. If values are low (0, 1, 2, 3), the color is dark. E.g. #111827 is very dark navy/slate.
  3. Check Saturation: If all three pairs are identical or very close (e.g. #666666 or #D1D5DB), the color has zero or low chromatic saturation (neutral gray). When one channel is high and others are low (e.g. #FF0055), the color is vibrant and saturated.

Ready to convert HEX codes to RGB, RGBA, and CMYK?

Convert hex codes in real-time, inspect channel breakdowns, and export print-ready CMYK separations.