xcolor icon indicating copy to clipboard operation
xcolor copied to clipboard

Different color function outputs

Open japorized opened this issue 3 years ago • 1 comments

Hello and thank you all for this amazing tool.

I was wondering if there's an interest in adding different color function outputs (particularly for HSL, for now). I was thinking of making a PR, but I wasn't certain if that fits within the vision of its maintainers.

In terms of implementation, I was thinking of performing a conversion from RGB, right before printing the output. However, and I'm not familiar with the problems in color conversions, conversions may be lossy (e.g. RGB to HSL). To make things worse, HSL, for example, uses decimals, i.e floating point math, which is

  1. difficult for accuracy
  2. adds complexity to testing

What do you all think? Is it worth pursuing?

japorized avatar Aug 17 '22 01:08 japorized

To make things worse, HSL, for example, uses decimals, i.e floating point math

Most HSL picker/wheel I see don't allow for decimals because no one really cares about 8.0 vs 8.4. It should be possible to use 32bit integers to convert rgb to HSL with a margin of error of 0.5.

N-R-K avatar Sep 08 '22 05:09 N-R-K