From 2c062daa03c4ac7df48150afb0d4f52f715ad1f1 Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Wed, 14 Oct 2026 12:42:43 +0300 Subject: [PATCH] Colour names: show a palette colour by its index (#1748) Unnamed ACI colours printed their RGB, which read the same as a true colour of that value. Co-Authored-By: Claude Opus 5.5 --- src/ui/color_select.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/ui/color_select.rs b/src/ui/color_select.rs index 3658a251e..5b3c775cb 100644 --- a/src/ui/color_select.rs +++ b/src/ui/color_select.rs @@ -82,16 +82,13 @@ pub fn aci_string_to_color(s: &str) -> AcadColor { } /// Display name for a colour: the standard name for ACI 1-9 / ByLayer / -/// ByBlock, otherwise the "R,G,B" values (0-255) so unnamed palette colours -/// read meaningfully. +/// ByBlock, the index for any other palette colour and "R,G,B" for a true +/// colour, so the two kinds read apart (#1748). pub fn color_display_name(c: AcadColor) -> String { let (_, label) = acad_color_display(c); if label == "Index" || label == "Custom" { match c { - AcadColor::Index(i) => { - let (r, g, b) = codec::types::aci_table::aci_to_rgb(i).unwrap_or((128, 128, 128)); - format!("{r},{g},{b}") - } + AcadColor::Index(i) => i.to_string(), AcadColor::Rgb { r, g, b } => format!("{r},{g},{b}"), _ => label.to_string(), }