From 09500617b898a3a2c86cc7c7699e0012fe1d9be4 Mon Sep 17 00:00:00 2001 From: zitann2020 Date: Sat, 31 Oct 2026 02:03:58 +0900 Subject: [PATCH 1/3] ui: the channel button keeps the red, green and blue After Effects gives it Co-Authored-By: DeepSeek V4.1 Flash --- crates/ui-egui/src/icons.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/icons.rs b/crates/ui-egui/src/icons.rs index 20a62c68a..c64c7c113 100644 --- a/crates/ui-egui/src/icons.rs +++ b/crates/ui-egui/src/icons.rs @@ -164,6 +164,13 @@ impl Pen16<'_> { fn dot(&self, x: f32, y: f32, r: f32) { self.painter.circle_filled(self.p(x, y), r * self.s(), self.color); } + /// A filled dot in its own colour, for the icons that are coloured in After Effects too (the + /// channel picker's red, green and blue). The tint's alpha is kept, so a dimmed button stays + /// dimmed. + fn dot_colored(&self, x: f32, y: f32, r: f32, color: Color32) { + let a = (color.a() as u16 * self.color.a() as u16 / 255) as u8; + self.painter.circle_filled(self.p(x, y), r * self.s(), Color32::from_rgba_unmultiplied(color.r(), color.g(), color.b(), a)); + } fn rect(&self, x0: f32, y0: f32, x1: f32, y1: f32) { let r = Rect::from_min_max(self.p(x0, y0), self.p(x1, y1)); self.painter.rect_stroke(r, 1.0 * self.s(), Stroke::new(self.width * self.s(), self.color), egui::StrokeKind::Middle); @@ -653,9 +660,11 @@ pub fn paint(painter: &Painter, rect: Rect, icon: Icon, color: Color32) { pen.line(&[(6.0, 14.0), (2.0, 14.0), (2.0, 10.0)]); } Channel => { - pen.circle(6.0, 6.5, 3.6); - pen.circle(10.0, 6.5, 3.6); - pen.circle(8.0, 10.0, 3.6); + // After Effects draws this one in colour: red over green and blue, as the channels it + // picks between. The shape stays this crate's own; only the three circles are filled. + pen.dot_colored(6.2, 6.0, 3.1, Color32::from_rgb(226, 58, 58)); + pen.dot_colored(10.0, 6.0, 3.1, Color32::from_rgb(58, 200, 88)); + pen.dot_colored(8.1, 9.9, 3.1, Color32::from_rgb(64, 120, 235)); } Exposure => { pen.circle(8.0, 8.0, 5.5); From 9aaf0254a7c762a62a278f5b0d52d8e676f1c1dc Mon Sep 17 00:00:00 2001 From: zitann2020 Date: Sat, 31 Oct 2026 02:37:03 +0900 Subject: [PATCH 2/3] ui: the channel icon keeps its circles and only gains their colour Co-Authored-By: DeepSeek V4.1 Flash --- crates/ui-egui/src/icons.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/ui-egui/src/icons.rs b/crates/ui-egui/src/icons.rs index c64c7c113..e2435d9c4 100644 --- a/crates/ui-egui/src/icons.rs +++ b/crates/ui-egui/src/icons.rs @@ -660,11 +660,11 @@ pub fn paint(painter: &Painter, rect: Rect, icon: Icon, color: Color32) { pen.line(&[(6.0, 14.0), (2.0, 14.0), (2.0, 10.0)]); } Channel => { - // After Effects draws this one in colour: red over green and blue, as the channels it - // picks between. The shape stays this crate's own; only the three circles are filled. - pen.dot_colored(6.2, 6.0, 3.1, Color32::from_rgb(226, 58, 58)); - pen.dot_colored(10.0, 6.0, 3.1, Color32::from_rgb(58, 200, 88)); - pen.dot_colored(8.1, 9.9, 3.1, Color32::from_rgb(64, 120, 235)); + // After Effects draws this one in colour: red, green and blue, as the channels it picks + // between. The circles keep the geometry this icon already had; only their fill changes. + pen.dot_colored(6.0, 6.5, 3.6, Color32::from_rgb(226, 58, 58)); + pen.dot_colored(10.0, 6.5, 3.6, Color32::from_rgb(58, 200, 88)); + pen.dot_colored(8.0, 10.0, 3.6, Color32::from_rgb(64, 120, 235)); } Exposure => { pen.circle(8.0, 8.0, 5.5); From 1c0a363f3fb342a0346f1bc9f6a3cc230ca5c09d Mon Sep 17 00:00:00 2001 From: zitann2020 Date: Sat, 31 Oct 2026 02:50:28 +0900 Subject: [PATCH 3/3] ui: the channel icon dims with its button instead of darkening twice Co-Authored-By: DeepSeek V4.1 Flash --- crates/ui-egui/src/icons.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/icons.rs b/crates/ui-egui/src/icons.rs index e2435d9c4..eec054fff 100644 --- a/crates/ui-egui/src/icons.rs +++ b/crates/ui-egui/src/icons.rs @@ -168,8 +168,9 @@ impl Pen16<'_> { /// channel picker's red, green and blue). The tint's alpha is kept, so a dimmed button stays /// dimmed. fn dot_colored(&self, x: f32, y: f32, r: f32, color: Color32) { - let a = (color.a() as u16 * self.color.a() as u16 / 255) as u8; - self.painter.circle_filled(self.p(x, y), r * self.s(), Color32::from_rgba_unmultiplied(color.r(), color.g(), color.b(), a)); + // `gamma_multiply` keeps the premultiplied channels consistent, so a dimmed tint dims the + // circle instead of darkening it twice. + self.painter.circle_filled(self.p(x, y), r * self.s(), color.gamma_multiply(self.color.a() as f32 / 255.0)); } fn rect(&self, x0: f32, y0: f32, x1: f32, y1: f32) { let r = Rect::from_min_max(self.p(x0, y0), self.p(x1, y1));