Closed JuanPotato closed 2 years ago
Thank you very much for your contribution!
I would prefer if we extract the binary search code into a separate function and add some tests for it.
Without having looked at the code in detail: if we modify a color in Lab space (which is what we should do for this problem :+1:), we have to make sure not to leave the sRGB gamut. The library will handle this for us but one often ends up with strangely saturated colors. Maybe this is not a problem here, since we are only modifying the lightness channel here which probable means that the sRGB gamut surface will be reached when the color is completely white or black.
Should I put the function in the same file when extracting it?
Should I put the function in the same file when extracting it?
yes, I think that's fine.
Well, there's a small issue with the binary search. It never manages to get all the way to #FFFFFF white or #000000 black. If I change the min and max range for the binary search to a past 0 and 100, so -1 and 101. It will get to pure white and black
Well, there's a small issue with the binary search. It never manages to get all the way to #FFFFFF white or #000000 black. If I change the min and max range for the binary search to a past 0 and 100, so -1 and 101. It will get to pure white and black
Do you think this could be related to #108?
I know the lab = lab.into_color().to_lab();
line is due to that issue. Fixing it would definitely help.
Closing for now since this is rather old. We can always resurrect it later.
Closes #89