You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
you have follow lightness normalization: (1 - $labColor['L'] / 200)
If we follow strict classical mathematical rules about any kind of normalization, lightness normalization in your code must be looks like: (1 - $labColor['L'] / 100)
It turns out that you have an extra 1/2 constant for lightness normalization. I understand that it is not cause any problem with correctness of sort algorithm itself, because you multiply EACH lightness value by this constant and this is why it is still correct. But I do not understand why do you divide L param by 200, not by 100?
The text was updated successfully, but these errors were encountered:
Hello,
according to the article about CIELAB color space from your code:
https://github.com/thephpleague/color-extractor/blob/master/src/ColorExtractor.php#L275
https://en.wikipedia.org/wiki/CIELAB_color_space
area of definition of lightness param (L*/Lstar) is [0:100], where 0 - black, 100 - white. But in colors' sorting algorithm
https://github.com/thephpleague/color-extractor/blob/master/src/ColorExtractor.php#L58
you have follow lightness normalization:
(1 - $labColor['L'] / 200)
If we follow strict classical mathematical rules about any kind of normalization, lightness normalization in your code must be looks like:
(1 - $labColor['L'] / 100)
It turns out that you have an extra 1/2 constant for lightness normalization. I understand that it is not cause any problem with correctness of sort algorithm itself, because you multiply EACH lightness value by this constant and this is why it is still correct. But I do not understand why do you divide L param by 200, not by 100?
The text was updated successfully, but these errors were encountered: