How color converter works
Colors on screens are described in several formats. Hex (hexadecimal) codes like #ff8000 pack red, green, and blue values into a compact string. RGB lists the same three values as decimal numbers (0 to 255). HSL describes color by hue (a circle of 360 degrees), saturation, and lightness.
This converter accepts either a hex color (with or without #, in any CSS form: 3-digit #rgb, 4-digit #rgba, 6-digit #rrggbb or 8-digit #rrggbbaa) or an RGB triplet (comma-separated, optionally with a fourth alpha value). It immediately shows the color in all three formats: hex, RGB, and HSL. When alpha is present, rgba() and hsla() strings are reported too, because an opaque hex and a translucent one are different colors. The conversion uses the standard sRGB formulas. Hex and RGB are direct mappings, while HSL is derived from the RGB values.
HSL hue is calculated by finding which of red, green, or blue is largest, then measuring the angular position on the color wheel. Saturation and lightness describe how vivid and how bright the color is. Pure red (#ff0000) is hue 0 degrees, 100 percent saturation, 50 percent lightness.