misund / hex-to-rgba

Converts CSS hexadecimal color codes to rgba().

Home Page:https://www.npmjs.com/package/hex-to-rgba

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Possible wrong value in converting most of the values

sagrawal31 opened this issue · comments

I'm trying to convert #66ffffff to RGBa without passing the alpha as 2nd parameter-

Actual Behaviour

rgba(102, 255, 255, 1)

Expected Behaviour

rgba(255, 255, 255, 0.4) as 66 is 40% transparent https://gist.github.com/lopspower/03fb1cc0ac9f32ef38f4.

I debug the code and came to know that the two-digit alpha needs to be at the end while I'm expecting it to be at the start.

The alpha value of a css hex is at the end. Details are available here.

Thanks for pointing out again!