sharkdp/pastel

Setting lab lightness value does not work as expected?

Open

#108 opened on Oct 27, 2019

View on GitHub
 (3 comments) (1 reaction) (0 assignees)Rust (127 forks)github user discovery
bughelp wanted

Repository metrics

Stars
 (6,392 stars)
PR merge metrics
 (PR metrics pending)

Description

I would expect pastel set lightness 100 to set a color's lab lightness to 100. The code does seem to try and set lab.l = value but it doesn't actually result in a lab lightness value of 100. Which seemed odd.

 % pastel format lab orange
Lab(75, 24, 79)
 % pastel set lightness 100 orange | pastel format lab
Lab(92, -8, 68)

I have no idea if this is an issue with converting between colorspaces or just unavoidable.

At 149, the lab lightness value seems to be shown as 100, but it isn't pure white.

 % pastel set lightness 149 orange | pastel format lab
Lab(100, -3, 9)

At 156, it finally reaches pure white.

 % pastel set lightness 156 orange | pastel format lab
Lab(100, 0, -0)

You can keep try setting it to 100 lightness and it will increase slightly which is odd

 % pastel set lightness 100 orange | pastel format lab
Lab(92, -8, 68)
 % pastel set lightness 100 orange | pastel set lightness 100 | pastel format lab
Lab(98, -17, 65)
 % pastel set lightness 100 orange | pastel set lightness 100 | pastel set lightness 100 | pastel format lab
Lab(98, -17, 63)

Contributor guide