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

Add utility methods to darken/lighten colors #2842

Open
freakboy3742 opened this issue Sep 14, 2024 · 0 comments
Open

Add utility methods to darken/lighten colors #2842

freakboy3742 opened this issue Sep 14, 2024 · 0 comments
Labels
enhancement New features, or improvements to existing features.

Comments

@freakboy3742
Copy link
Member

What is the problem or limitation you are having?

Tools like SCSS and SASS provide utility methods to darken an lighten colors. These can be useful for defining de-emphasized secondary headings etc. Toga should provide utility methods to

Describe the solution you'd like

It should be possible to call toga.Color(...).lighten(X) or toga.Color(...).darken(X) to generate a new color that is lighter/darker by X% (where X is a float in the range 0-1).

It may also be useful to have analogs of these methods that go in the right "direction" when dark mode is taken into account (i.e. in light mode, lightening is used for de-emphasis; but in dark mode, darkening is used for de-emphasis). See #2841 for a related issue.

Describe alternatives you've considered

This is already possible using HSL colorspace definitions; however, Travertino doesn't provide mechanism for converting from RGBA to HSLA.

Additional context

See #2830 for the original request.

@freakboy3742 freakboy3742 added the enhancement New features, or improvements to existing features. label Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New features, or improvements to existing features.
Projects
None yet
Development

No branches or pull requests

1 participant