HEX To RGB
Reverse Conversion
How This Converter Works
Parses six-digit hexadecimal RGB or, when alpha is enabled, an eight-digit RGBA hex value, with an optional leading #.
Formula or rule
Each RGB pair is parsed as base 16; an enabled alpha byte is divided by 255 and rounded to three decimal places for display.
Example
- Input
- #FF000080 with alpha enabled
- Calculation
- FF=255, 00=0, 00=0; 80 hex=128 and 128/255 rounds to 0.502.
- Result
- rgba(255,0,0,0.502)