bevy/crates/bevy_render
Michał Iwańczuk 04b42132a8 Add 'Color::as_lcha' function (#7757) (#7766)
# Objective
Fixes #7757

New function `Color::as_lcha` was added and `Color::as_lch_f32` changed name to `Color::as_lcha_f32`.

----
As a side note I did it as in every other Color function, that is I created very simillar code in `as_lcha` as was in `as_lcha_f32`. However it is totally possible to avoid this code duplication in LCHA and other color variants by doing something like :
```
 pub fn as_lcha(self: &Color) -> Color {
    let (lightness, chroma, hue, alpha) = self.as_lcha_f32();
    return Color::Lcha { lightness, chroma, hue, alpha };
}
```
This is maybe slightly less efficient but it avoids copy-pasting this huge match expression which is error prone. Anyways since it is my first commit here I wanted to be consistent with the rest of code but can refactor all variants in separate PR if somebody thinks it is good idea.
2023-03-05 12:26:14 +00:00
..
macros Support raw buffers in AsBindGroup macro (#7701) 2023-02-22 22:43:29 +00:00
src Add 'Color::as_lcha' function (#7757) (#7766) 2023-03-05 12:26:14 +00:00
Cargo.toml Update glam to 0.23 (#7883) 2023-03-04 11:42:27 +00:00