diff --git a/content/news/2023-10-21-bevy-0.12/index.md b/content/news/2023-10-21-bevy-0.12/index.md index 5321faf913..6f2411d794 100644 --- a/content/news/2023-10-21-bevy-0.12/index.md +++ b/content/news/2023-10-21-bevy-0.12/index.md @@ -19,6 +19,25 @@ Since our last release a few months ago we've added a _ton_ of new features, bug
+## Added HSL methods to `Color` struct + + + +You can now use `h()`, `s()`, `l()` together with their `set_h()`, `set_s()`, `set_l()` and `with_h()`, `with_s()`, `with_l()` variants to manipulate *Hue*, *Saturation* and *Lightness* values of a `Color` struct without cloning. Previously you could do that only with RGBA values. + +```rust +// Returns HSL component values +let color = Color::ORANGE; +let hue = color.h(); + +// Changes the HSL component values +let mut color = Color::PINK; +color.set_s(0.5); + +// Modifies existing colors and returns them +let color = Color::VIOLET.with_l(0.7); +``` + ## What's Next? We have plenty of work that is pretty much finished and is therefore very likely to land in **Bevy 0.13**: