Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grays are Treated as Reds in Hue Gradient and Sort By Hue #2901

Open
behreajj opened this issue Aug 19, 2021 · 0 comments
Open

Grays are Treated as Reds in Hue Gradient and Sort By Hue #2901

behreajj opened this issue Aug 19, 2021 · 0 comments
Labels

Comments

@behreajj
Copy link
Contributor

Hello,

The version and platform I'm using doesn't pertain here, as this is a problem general to a lot of software.

Probably as an artifact of treating zero as a substitute for invalid, not a number, infinity or whatever result you want to assign to n / 0, gray colors are treated as reds in hue operations. There are certain cases where this is probably intended, such as HSV+ and HSL+ hue adjustments. There are other cases, as in the color picker, where this is avoided - when a color's saturation is dragged to zero, its hue is preserved for a time.

In hue gradients it leads to results like this
redGrayCyanGradient

Green and cyan are most adversely impacted, as they are furthest away from red on the color wheel (depending on which color wheel you use, the complement of red varies).

You could argue that this is conventional: it is how many other software packages handle hue gradients. I tested GIMP, Krita, Blender. I think it would make more sense to default to an sRGB gradient in cases where either the origin or the destination is desaturated. Think for example of a case where a gradient for a metallic surface is being created.

Sorting a gradient like this by hue

beforeSort

gives this result

afterSort

Ideally, the grays would be clumped together before any of the other hues.

behreajj added a commit to behreajj/aseprite that referenced this issue Aug 28, 2021
Removes switch case with fall through. Removes nested switch cases. Refactors color sorting method to 1. push zero alpha colors to the front of the palette; 2. resort to value as a criterion for gray colors; 3. use saturation and value as back up comparisons for each other for equivalent values; 4. approximate gamma-to-linear when perceptual lightness is chosen.

Partial fix for aseprite#2901.
dacap pushed a commit that referenced this issue Aug 30, 2021
Removes switch case with fall through. Removes nested switch
cases. Refactors color sorting method to 1. push zero alpha colors to
the front of the palette; 2. resort to value as a criterion for gray
colors; 3. use saturation and value as back up comparisons for each
other for equivalent values; 4. approximate gamma-to-linear when
perceptual lightness is chosen.

Partial fix for #2901.
@dacap dacap added the colorbar label Aug 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants