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

Color migration guide #1379

Merged
merged 5 commits into from
Jun 11, 2024
Merged

Conversation

BD103
Copy link
Member

@BD103 BD103 commented Jun 8, 2024

Originally part of #1376, but I split it out due to the amount of content.

This is the draft migration guide for the new color module. Please review it, re-organize it, and correct it as much as you like!

@BD103
Copy link
Member Author

BD103 commented Jun 8, 2024

- `Color::set_a` and `Color::a` is now `Color::set_alpha` and `Color::alpha`. These are part of the `Alpha` trait in `bevy_color`.
- `Color::is_fully_transparent` is now part of the `Alpha` trait in `bevy_color`
- `Color::r`, `Color::set_r`, `Color::with_r` and the equivalents for `g`, `b` `h`, `s` and `l` have been removed due to causing silent relatively expensive conversions. Convert your `Color` into the desired color space, perform your operations there, and then convert it back into a polymorphic `Color` enum.
- `Color::hex` is now `Srgba::hex`. Call `.into` or construct a `Color::Srgba` variant manually to convert it.
Copy link

Choose a reason for hiding this comment

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

or .to_srgba()

Copy link
Member Author

Choose a reason for hiding this comment

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

What section are you referring to for this? You commented on removed text that no longer exists, so I'm not sure what you're talking about.

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jun 11, 2024
Merged via the queue into bevyengine:main with commit c57c223 Jun 11, 2024
10 checks passed
@BD103 BD103 deleted the color-migration-guide branch June 11, 2024 01:46
@BD103 BD103 mentioned this pull request Jun 13, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants