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
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:
When an RGB channel value exceeds 255, it is set to 255, sometimes causing the color hue to shift.
Some colors do weird things, for example blue converted to red.
The vast huge majority of colors are converted without issue. Respect the farver.
Edit: I can't tell if the "cap" step is the cause of red.
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:
Fix the source of red - possible memory bug if numeric values are showing up in odd places. Total guess. I noticed in the upstream ColorSpace, it appears to subtract 255 only once if a channel exceeds 255 - what happens if blue channel is 600? Not sure why that would return R=255,B=0,G=0.
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.
Something to indicate when color conversion went badly, so I can tell what is out of bounds.
Sorry I couldn't yet determine where the bug is occurring, maybe it will make sense to you?
The text was updated successfully, but these errors were encountered:
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:
Produces this table of HCL values:
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?
The text was updated successfully, but these errors were encountered: