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

Linear gradient #2038

Merged
merged 2 commits into from
May 26, 2022
Merged

Linear gradient #2038

merged 2 commits into from
May 26, 2022

Conversation

erf
Copy link
Contributor

@erf erf commented May 26, 2022

I've added a new Directional gradient as suggested in #2023. I've also included a example to the window_background_gradient.md.

It's a linear gradient which can be rotated around the window center. Using radians per now. Should i change this to degrees?

You should now be able to add diagonal (or similar) gradients like in this example.

Here's the screenshot I've used in the example:
directional-gradient

This is my first time using Rust, but the other examples made it quite easy to implement. Suggestions are welcomed.

Copy link
Owner

@wez wez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, thank you!

I think the angle should be specified in degrees in the config, as that is more of a lay-person's unit, and is easier to intuit what a given degree value means than the equivalent in radians!

regarding the name Directional, what do you think about maybe renaming it to Linear?
That feels closer to the CSS equivalent: https://developer.mozilla.org/en-US/docs/web/css/gradient/linear-gradient

@erf
Copy link
Contributor Author

erf commented May 26, 2022

I agree. Will fix :)

@erf
Copy link
Contributor Author

erf commented May 26, 2022

Renamed to Linear and use degrees now. Also added "Only in nightly" to doc.

@erf erf changed the title Directional gradient Linear gradient May 26, 2022
@wez
Copy link
Owner

wez commented May 26, 2022

Thanks!

@wez wez merged commit 6a32000 into wez:main May 26, 2022
wez added a commit that referenced this pull request May 26, 2022
@erf erf deleted the directional-gradient branch May 27, 2022 12:56
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 this pull request may close these issues.

2 participants