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

Change how darken/lighten and saturate/desaturate works #215

Closed
Ogeon opened this issue Apr 10, 2021 · 0 comments · Fixed by #217
Closed

Change how darken/lighten and saturate/desaturate works #215

Ogeon opened this issue Apr 10, 2021 · 0 comments · Fixed by #217

Comments

@Ogeon
Copy link
Owner

Ogeon commented Apr 10, 2021

The current implementation of lighten and darken uses absolute values (like self.lightness + amount), but that gives wildly different results between color spaces and isn't usually desired result. It may be more useful if they changed relative to the extremes, like self.lightness + (1.0 - self.lightness) * amount. The current behavior is on the other hand also useful.

Saturate and desaturate are currently implemented as self.saturation * (1.0 + factor) and self.saturation * (1.0 - factor), but should be changed to have the same behavior as lighten/darken.

I'm thinking it would be nice to give both options, but make the relative mode the "default". So there could be lighten and lighten_absolute or lighten_fixed and so on. The relative modes could be default implemented using the absolute modes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant