bevy/crates/bevy_color
Torstein Grindvik 8b25ef3328
Allow bevy_color use without bevy_reflect support (#13870)
# Objective

Allow the use of color definitions from Bevy in other contexts than pure
Bevy apps, e.g. outside ECS use.
In those cases it's nice to not have more dependencies than you need.

## Solution

Hide use of reflection behind a feature flag.
Defaults to on.

## Points to consider

1. This was straightforward _except_ for the
`crates/bevy_color/src/lib.rs` change where I removed `Reflect` as a
bound. That is awkward to have feature gated since features should be
additive. If the bound was added as part of the feature flag, the result
would be _more_ restrictive, and _disable_ impls which did not have the
impl. On the other hand having the reflect bound there unconditionally
would defeat the purpose of the PR. I opted to remove the bound since it
seems overly restrictive anyway.
2. It's possible to hide `encase` and `bytemuck` behind the new feature
flag too (or a separate one). I'm thinking if `bevy-support` is not
desired then it's unlikely that the user has need of those.

---------

Signed-off-by: Torstein Grindvik <torstein.grindvik@muybridge.com>
Co-authored-by: Torstein Grindvik <torstein.grindvik@muybridge.com>
2024-06-16 15:47:30 +00:00
..
crates/gen_tests bevy_color: Add Oklch Color Space (#12168) 2024-02-28 01:22:55 +00:00
docs bevy_color: Added Color Conversion Mermaid Diagram (#12147) 2024-02-27 06:03:34 +00:00
src Allow bevy_color use without bevy_reflect support (#13870) 2024-06-16 15:47:30 +00:00
Cargo.toml Allow bevy_color use without bevy_reflect support (#13870) 2024-06-16 15:47:30 +00:00
README.md Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00

Bevy Color

License Crates.io Downloads Docs Discord