How do you convert HEX to RGB?
A six-digit CSS HEX color has two hexadecimal digits per red, green and blue channel. Convert each pair to a number from 0 through 255. For example, #336699 gives 51 red, 102 green and 153 blue, or rgb(51 102 153). In a three-digit HEX color, repeat each digit first. So #369 is also #336699.
How do you convert RGB to HSL?
RGB names the red, green and blue components of an sRGB color. HSL describes the same color with hue in degrees and saturation and lightness in percentages. Normalize the RGB components from 0 through 1. Lightness is the midpoint of the largest and smallest component. Hue depends on the dominant component, while saturation describes the spread relative to the lightness. The W3C CSS Color 4 HSL specification documents both directions.
For #336699, the result is hsl(210 50% 40%). For a gray where all three RGB components are equal, saturation is zero and hue has no visual effect. The converter displays that hue as zero.
How is transparency handled?
Alpha means opacity. In rgb(255 0 0 / 50%), the alpha is 0.5. CSS HEX stores that opacity as a byte. The closest byte is 128, so the HEX result is #FF000080. That byte represents 128/255, about 50.196%. The RGB and HSL results keep 0.5 before display rounding. In four-digit HEX, the fourth digit is opacity and is doubled, just like the three color digits.
Which color inputs are supported?
Use 3, 4, 6 or 8 HEX digits, RGB channels as numbers or percentages, or HSL with hue in degrees and two percentages. CSS functions may use commas or spaces with a slash before alpha. A pasted RGB or HSL value may also omit the function wrapper if the format is selected. Values outside channel ranges are rejected. The tool covers sRGB color notation and does not convert named colors, wide-gamut colors, CMYK profiles, or design-specific color accessibility.