Convert one translucent swatch between color models
Admin ·
A design file may give you HSV while a stylesheet uses HSL. First identify which model supplied the numbers. At the same hue and saturation, brightness in HSV and lightness in HSL can describe visibly different swatches.
Start with a blue swatch
Enter rgba(51, 102, 153, 0.5). HEX8 gives #33669980 and HSL gives hsl(210 50% 40% / 0.5). In HEX8 the last byte represents 128/255, slightly more than one half. Copy the functional notation to keep the original 0.5.
Read the RGB extrema as HWB
The smallest RGB channel is 51/255, giving 20% whiteness. The largest is 153/255, giving 40% blackness. Enter hwb(210 20% 40% / 0.5) to recover the starting swatch. When whiteness and blackness sum to at least 100%, their ratio determines a gray.
Use the HSV readout in a design tool
The largest channel sets value to 60%. Saturation is the difference between the largest and smallest channels divided by the largest, about 66.667%. Paste hsv(210 66.667% 60% / 0.5) into this converter. Use its RGB, HSL, HWB or HEX output when writing a stylesheet.
Round-trip an accent with partial opacity
The last byte of #33669980 is hexadecimal 80, or 128 decimal. If a design system uses opacity as a percentage, dividing by 255 gives about 50.2%. Rounding to 50% can still return the same 8-bit alpha after another conversion.
Compare the rendered accent on the same background before comparing screenshots. A translucent color over white and the same value over gray can look different even when both converters agree on the channels.
Common questions
Why does a gray swatch show hue zero?
All three RGB channels are equal. Any hue produces the same gray at zero saturation, so the conversion displays zero.
How can I get eight digits for an opaque color?
Copy HEX8. It always includes the alpha byte, which is FF at full opacity.
Sources
Put it into practice.
Related guides
- How to Convert HEX to RGB and RGBA
- Choosing a color harmony from one swatch
- Making an sRGB ramp with tints and shades
- Compare Status Swatches in Color Vision Views
- Compare Three Red and Blue Midpoints
- Check a One-Channel Match to Tomato
- Compare Unprofiled CMYK and Screen Colors
- Invert an sRGB Swatch and Keep its Alpha
- Choose an sRGB Fallback for OKLCH
- Verify Light and Dark Design Tokens
- Measure Swatch and Label Placement on A4
- Compare Screen Colors and Responsive CSS
- Match RGB to the 216 Web Safe Colors
- Check a Coral Swatch in Grayscale
- Look Up a CSS Named Color and Its Aliases