Open jmw86069 opened 3 years ago
I know this issue is low-priority and that's alright. :) I'm working around by forcing in-gamut colors for each hue in my work.
I'm just posting a screenshot, realizing I could have just copied/pasted. smh
These colors were all obtained with hue=250
and should more or less be blue:
The first 2 colors have chroma set out of gamut for blue, and they are corrected weirdly.
I really love this package - and pretty much all your packages!
I'm reporting a bug I discovered with some HCL input values. Current workaround is not to request these HCL values, but no indication when it occurs. :) It could be a memory leak issue.
As I understand it, when farver converts a color type to RGB or hex, each RGB channel is "capped" at 255.
I observed three behaviors:
Edit: I can't tell if the "cap" step is the cause of red.
I'll narrate briefly:
h=250
(blue), luminancel=20
(dark).c
values from 140 to 60.The hcl output is shown below:
The cyan output is expected - RGB blue channel value above 255, capped at 255. The green channel must be high, producing cyan.
The red output is unexpected.
I should post the RGB output:
I tried to circumvent the issue by direct conversion of HCL to something else (e.g.
"hcl"
to"hsl"
) - but I think everything goes through an RGB intermediate? Could be wrong there, the code is clever with the dynamic function calls.Potential workarounds:
Rgb::Cap()
scales all RGB values so the max value is 255, instead of capping at 255; preserving the hue. This would reduce brightness for some colors.Sorry I couldn't yet determine where the bug is occurring, maybe it will make sense to you?