git.lucas.co / cce-ui
GPU-accelerated UI toolkit (Vulkan)
git clone https://git.lucas.co/cce-ui.git

commit93410eea4134430d4aee47792ccb38550ffa2255
parente1eaec28fa
authorLucas Galante <[email protected]>
date2026-07-01 13:19
Fix text label color space conversion and correct sRGB colors in tree configuration

 src/widget/container/treelist.rs | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/widget/container/treelist.rs b/src/widget/container/treelist.rs
index b9024be..50f4cd7 100644
--- a/src/widget/container/treelist.rs
+++ b/src/widget/container/treelist.rs
@@ -448,7 +448,11 @@ impl Element for TreeList {
 
     fn text_labels(&self) -> Vec<TextLabel> {
         let f32_to_rgb = |c: [f32; 4]| -> [u8; 3] {
-            [(c[0] * 255.0).round() as u8, (c[1] * 255.0).round() as u8, (c[2] * 255.0).round() as u8]
+            [
+                (crate::color::linear_to_srgb(c[0]) * 255.0).round() as u8,
+                (crate::color::linear_to_srgb(c[1]) * 255.0).round() as u8,
+                (crate::color::linear_to_srgb(c[2]) * 255.0).round() as u8,
+            ]
         };
 
         let mut labels = Vec::new();