Strange thing that I discovered. When converting #579f2f
to hsl, I arrive at hsl(99, 54%, 40%);
. When converting this back to hex I get #559d2f
. I used various online tools to test this.
I guess the reason is that hsl describes the colors as hue (0-360), saturation (0-100%) and lightness (0-100%) and hex is just RGB (0-255,0-255,0-255) written as three hexadecimal numbers, so the color space hsl describes (or the amount of colors you can possibly express) is different.
RGB: 255^3 = 16,581,375 colors
HSL: 360*100*100 = 3,600,000 colors
Am I right in this assumption or is there a different reason?
hsl(98.6, 54.4%, 40.4%)
so I'd say it's because of the rounding. Try it here: convertacolor.com – Keckhsl(360,100,100)
andrgb(255,255,255)
, then the amount of values you can express is much larger for rgb. – Normie256^3
, but please try not to assume 8bit values, and BTW in hsl, all values with S=0 or L=0 describe the same colour. – Delative