forked from 1b-agent/opencadstudio-upstream
Merge main into Select-Color-Redesign
Keep both sides: main's ViewBackground colour target and PREVIEW icon next to this branch's Interface target and LIST/SEARCH icons. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013rGmDUNr1hUf4zo1X3dak8
This commit is contained in:
231 files changed
+32217
-3423
No files matched your search
@@ -57,16 +57,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(),
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user