bevy/examples/2d
François bcd5318247 color spaces and representation (#1572)
`Color` can now be from different color spaces or representation:
- sRGB
- linear RGB
- HSL

This fixes #1193 by allowing the creation of const colors of all types, and writing it to the linear RGB color space for rendering.

I went with an enum after trying with two different types (`Color` and `LinearColor`) to be able to use the different variants in all place where a `Color` is expected.

I also added the HLS representation because:
- I like it
- it's useful for some case, see example `contributors`: I can just change the saturation and lightness while keeping the hue of the color
- I think adding another variant not using `red`, `green`, `blue` makes it clearer there are differences

Co-authored-by: Carter Anderson <mcanders1@gmail.com>
2021-03-17 23:59:51 +00:00
..
contributors.rs color spaces and representation (#1572) 2021-03-17 23:59:51 +00:00
sprite.rs Bevy ECS V2 (#1525) 2021-03-05 07:54:35 +00:00
sprite_flipping.rs Bevy ECS V2 (#1525) 2021-03-05 07:54:35 +00:00
sprite_sheet.rs ♻️ Timer refactor to duration. Add Stopwatch struct. (#1151) 2021-03-05 19:59:14 +00:00
text2d.rs Bevy ECS V2 (#1525) 2021-03-05 07:54:35 +00:00
texture_atlas.rs Redo State architecture (#1424) 2021-03-15 22:12:04 +00:00