mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
9ae5ba2e71
# Objective As suggested in #12163 by @cart, we should add convenience constructors to `bevy_color::Color` to match the existing API (easing migration pain) and generally improve ergonomics. ## Solution - Add `const fn Color::rgba(red, green, blue, alpha)` and friends, which directly construct the appropriate variant. - Add `const fn Color::rgb(red, green, blue)` and friends, which impute and alpha value of 1.0. - Add `const BLACK, WHITE, NONE` to `Color`. These are stored in `LinearRgba` to reduce pointless conversion costs and inaccuracy. - Changed the default `Color` from `Srgba::WHITE` to the new linear equivalent for the same reason. --------- Co-authored-by: Alice Cecile <alice.i.cecil@gmail.com> |
||
---|---|---|
.. | ||
crates/gen_tests | ||
docs | ||
src | ||
Cargo.toml |