antimatter15 / rgb-lab

convert between rgb and L*a*b color spaces in javascript
MIT License
169 stars 30 forks source link

Coding Mistake #1

Open mark-brooks-180 opened 5 years ago

mark-brooks-180 commented 5 years ago

In the return statement at the bottom of function rgb2lab() I believe the first element of the array is being calculated incorrectly. Presently the statement is: return [(116 y) - 16, 500 (x - y), 200 * (y - z)]

I believe it should be: return [(116 x) - 16, 500 (x - y), 200 * (y - z)]

zlk89 commented 4 years ago

According to https://en.wikipedia.org/wiki/CIELAB_color_space#RGB_and_CMYK_conversions, current code should be correct.