User Rating 0.0
Total Usage 3 times
Category CSS Tools
#
Invalid HEX format
Text Preview
Brightness-
Rec. Text-
Is this tool helpful?

Your feedback helps us improve.

About

Consistency in design systems requires strict adherence to color formats. While design tools like Figma or Sketch often export Hexadecimal codes (Base 16), CSS implementation frequently benefits from RGB or RGBA (Base 10) values, particularly when JavaScript manipulation or opacity adjustments are required. This tool parses raw Hex strings, validates the 16-base structure, and outputs the precise Red, Green, and Blue channels used by digital displays.

Beyond simple conversion, understanding perceived brightness is critical for accessibility. Text placed over a background color must maintain sufficient contrast to be readable. This converter calculates the luminance of the input color to suggest whether black or white text is the mathematically superior choice for overlay content.

color converter web design css tools hex rgb

Formulas

The conversion splits a 6-digit Hex string into three pairs. Each pair represents a color channel in Base 16, which is converted to Base 10 integers.

R = parseInt(hex[0,1], 16)
G = parseInt(hex[2,3], 16)
B = parseInt(hex[4,5], 16)

Brightness (YIQ contrast) is calculated to determine text readability:

Y = (R×299 + G×587 + B×114)1000

Reference Data

Color NameHEXRGB OutputLuminance Estimate
Pure Black#000000rgb(0, 0, 0)0% (Dark)
Pure White#FFFFFFrgb(255, 255, 255)100% (Light)
Red#FF0000rgb(255, 0, 0)~30% (Dark)
Green#00FF00rgb(0, 255, 0)~59% (Light)
Blue#0000FFrgb(0, 0, 255)~11% (Dark)
Mid Grey#808080rgb(128, 128, 128)50% (Neutral)
Cyan#00FFFFrgb(0, 255, 255)High Brightness
Magenta#FF00FFrgb(255, 0, 255)Medium Brightness

Frequently Asked Questions

Yes. If you enter a 3-digit code like #F0A, the tool automatically expands it to #FF00AA before converting, following standard CSS parsing rules.
The tool recognizes 8-digit codes as Hex with Alpha (RRGG BBAA). It converts the final pair into a float value between 0 and 1, outputting an rgba() string instead of rgb().
Human vision is most sensitive to green light. The formula (299*R + 587*G + 114*B) reflects the biological response of the human eye, ensuring that the calculated brightness matches perceived lightness.
Absolutely. The output is formatted as a valid CSS function string (e.g., rgb(255, 0, 0)) ready to be pasted into your stylesheet.