Joint dialog after the engine's mating default: the dialog's Flip is the command's flip (no double flip with 4c3a5d9); Appearance dialog on the new appearance model; AppearanceCommand takes a colour with any name (the dialog's palette names)
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01AS5Tn3xieewUSg3uxrMVdL
This commit is contained in:
1 parent
2c383460e9
commit
6653db806e
4 files changed
+19
-11
No files matched your search
@@ -303,6 +303,14 @@ fn appearance(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
use solvecraft_doc::appearance::{FaceLook, Look, library};
|
||||
let cmd = "AppearanceCommand";
|
||||
let look: Option<Look> = match (str_(p, "appearance"), p.get("color")) {
|
||||
// A colour with a name: that colour, called that (a name not in the library is fine).
|
||||
(Some(n), Some(v)) if !v.is_null() => {
|
||||
let c = color_param(v).ok_or_else(|| bad(cmd, "`color` must be \"#rrggbb\" or [r, g, b] with values 0–255"))?;
|
||||
let o = p.get("opacity").and_then(Value::as_f64).filter(|x| x.is_finite()).unwrap_or(1.0);
|
||||
let mut l = Look::custom(c, o);
|
||||
l.name = n.chars().take(128).collect();
|
||||
Some(l)
|
||||
}
|
||||
(Some(n), _) => {
|
||||
let mut l = library(n).ok_or_else(|| bad(cmd, format!("no appearance `{n}` in the library (appearance.library)")))?;
|
||||
if let Some(o) = p.get("opacity").and_then(Value::as_f64).filter(|x| x.is_finite()) {
|
||||
|
||||
Reference in new issue
Block a user