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
[f32; 4]
conversions missing from bevy_color
#13224
Labels
A-Color
Color spaces and color math
C-Usability
A simple quality-of-life change that makes Bevy easier to use
D-Trivial
Nice and easy! A great choice to get started with Bevy
X-Uncontroversial
This work is generally agreed upon
Milestone
Comments
tychedelia
added
C-Enhancement
A new feature
S-Needs-Triage
This issue needs to be labelled
labels
May 4, 2024
alice-i-cecile
added
D-Trivial
Nice and easy! A great choice to get started with Bevy
C-Usability
A simple quality-of-life change that makes Bevy easier to use
X-Uncontroversial
This work is generally agreed upon
A-Color
Color spaces and color math
and removed
C-Enhancement
A new feature
S-Needs-Triage
This issue needs to be labelled
labels
May 4, 2024
These should probably be methods rather than a trait as the semantic meaning is different for each color space. |
It may also be handy to implement conversion from a |
i'll start on this and see how far i can go |
github-merge-queue bot
pushed a commit
that referenced
this issue
May 9, 2024
# Objective fixes #13224 adds conversions for Vec3 and Vec4 since these appear so often ## Solution added Covert trait (couldn't think of good name) for [f32; 4], [f32, 3], Vec4, and Vec3 along with the symmetric implementation ## Changelog added conversions between arrays and vector to colors and vice versa #migration LinearRgba appears to have already had implicit conversions for [f32;4] and Vec4
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-Color
Color spaces and color math
C-Usability
A simple quality-of-life change that makes Bevy easier to use
D-Trivial
Nice and easy! A great choice to get started with Bevy
X-Uncontroversial
This work is generally agreed upon
What problem does this solve or what need does it fill?
Previously, we supported lots of operations back and forth from
[f32; 4]
that are currently missing with the exception ofto_f32_array
onLinearRgba
. Non-engine code sometimes needs to access these for other color spaces. The last one I ran into I believe was usingLcha
withlyon
for Nannou. Other libraries likeegui
also sometimes supply or expect these in their raw form.See the old docs
What solution would you like?
A trait or method impls to support
-> [f32; 4]
as well asFrom<[f32; 4]>
.The text was updated successfully, but these errors were encountered: