bevy/crates/bevy_color
Zachary Harrold 4d325eb3f0
bevy_color: Add Laba to support Lab Color Model (#12115)
# Objective

- Improve compatibility with CSS Module 4
- Simplify `Lcha` conversion functions

## Solution

- Added `Laba` which implements the Lab color model.
- Updated `Color` and `LegacyColor` accordingly.

## Migration Guide

- Convert `Laba` to either `Xyza` or `Lcha` using the provided `From`
implementations and then handle accordingly.

## Notes

The Lab color space is a required stepping stone when converting between
XYZ and Lch, therefore we already use the Lab color model, just in an
nameless fashion prone to errors.

This PR also includes a slightly broader refactor of the `From`
implementations between the various colour spaces to better reflect the
graph of definitions. My goal was to keep domain specific knowledge of
each colour space contained to their respective files (e.g., the
`From<Oklaba> for LinearRgba` definition was in `linear_rgba.rs` when it
probably belongs in `oklaba.rs`, since Linear sRGB is a fundamental
space and Oklab is defined in its relation to it)
2024-02-26 22:30:50 +00:00
..
crates/gen_tests bevy_color: Add Laba to support Lab Color Model (#12115) 2024-02-26 22:30:50 +00:00
src bevy_color: Add Laba to support Lab Color Model (#12115) 2024-02-26 22:30:50 +00:00
Cargo.toml Port bevy_core_pipeline to LinearRgba (#12116) 2024-02-26 12:25:11 +00:00