iamartyom / ColorHelper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HSL to RGB not returning the right color

sophisma opened this issue · comments

Hi, I was trying to convert HSL to RGB with ColorHelper and I noticed that the converted color doesn't match the original one, it's considerably darker.
To give you an example, when I convert hsl(120, 75%, 60%) to RGB I get rgb(39, 155, 39).
If you want to check how both colors look like just create an html file with the following code and open it on your browser.

<html>
<head>
</head>
<body>
</body>
<div style="width: 300px; height: 300px; background-color: hsl(120, 75%, 60%)">
This color is set with hsl(120, 75%, 60%)
</div>

<h1>ColorHelper converts hsl(120, 75%, 60%) to rgb(39, 155, 39)</h1>

<div style="width: 300px; height: 300px; background-color: rgb(39, 155, 39)">
This color is set with rgb(39, 155, 39)
</div>
</html>

Using an online converter, like this one https://www.rapidtables.com/convert/color/hsl-to-rgb.html, the real value is rgb(76,230,76).

Tried to convert to HEX and it also gives a darker color, #279B27.
Using the online converter it should be #4CE64C.

Well, I isolated the problem, it was between my chair and my keyboard.
I was converting to HSV and not HSL.
Everything good.

Hi @sophisma.
Thank you for your feedback.
I'm glad that everything is fine.