Commit 94ed750
authored
More UI gradients fixes (#20035)
# Objective
Improve the gradients implementation further.
## Solution
More UI gradients improvements:
* Use the more accurate gamma correction function from #12939.
* Fixed hsl and hsv conversion functions.
* Ignore hues and don't interpolate if the chroma or saturation is close
to zero.
before:
<img width="239" alt="colors"
src="https://github.com/user-attachments/assets/39443400-e550-49f5-a7de-4a07c5fe537a"
/>
after:
<img width="194" alt="image"
src="https://github.com/user-attachments/assets/a5977b97-aa1d-4254-9ef3-0d2355f2ab18"
/>
## Testing
The `testbed_ui` and `gradients` examples can be used for testing.1 parent 647b071 commit 94ed750
File tree
3 files changed
+259
-131
lines changed- crates/bevy_ui_render/src
- examples/testbed
3 files changed
+259
-131
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
665 | 665 | | |
666 | 666 | | |
667 | 667 | | |
668 | | - | |
| 668 | + | |
| 669 | + | |
669 | 670 | | |
670 | 671 | | |
671 | 672 | | |
| |||
676 | 677 | | |
677 | 678 | | |
678 | 679 | | |
679 | | - | |
680 | | - | |
681 | | - | |
682 | | - | |
683 | | - | |
684 | | - | |
685 | | - | |
| 680 | + | |
| 681 | + | |
686 | 682 | | |
687 | 683 | | |
688 | 684 | | |
689 | | - | |
690 | | - | |
| 685 | + | |
| 686 | + | |
691 | 687 | | |
692 | 688 | | |
693 | 689 | | |
| |||
0 commit comments