Skip to content

Commit

Permalink
Handle template boxes for colors
Browse files Browse the repository at this point in the history
  • Loading branch information
rhennigan committed Jan 4, 2025
1 parent 98445d1 commit 63ac922
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"Checkmarked",
"CICD",
"clicktocopy",
"CMYK",
"Componentwise",
"Connor",
"datarepository",
Expand Down
26 changes: 17 additions & 9 deletions Source/Chatbook/Serialization.wl
Original file line number Diff line number Diff line change
Expand Up @@ -199,15 +199,23 @@ $boxOp = <| SuperscriptBox -> "^", SubscriptBox -> "_" |>;

(* How to choose TemplateBox arguments for serialization *)
$templateBoxRules = <|
"AssistantMessageBox" -> First,
"ConditionalExpression" -> makeExpressionString,
"GrayLink" -> First,
"HyperlinkDefault" -> First,
"Key0" -> First,
"Key1" -> (Riffle[ #, "-" ] &),
"RowDefault" -> Identity,
"TransferFunctionModelFull" -> makeExpressionString,
"UserMessageBox" -> First
"AssistantMessageBox" -> First,
"ConditionalExpression" -> makeExpressionString,
"GrayLink" -> First,
"HyperlinkDefault" -> First,
"Key0" -> First,
"Key1" -> (Riffle[ #, "-" ] &),
"RowDefault" -> Identity,
"TransferFunctionModelFull" -> makeExpressionString,
"UserMessageBox" -> First,
"CMYKColorSwatchTemplate" -> inputFormString @* Lookup[ "color" ],
"GrayLevelColorSwatchTemplate" -> inputFormString @* Lookup[ "color" ],
"HueColorSwatchTemplate" -> inputFormString @* Lookup[ "color" ],
"LABColorSwatchTemplate" -> inputFormString @* Lookup[ "color" ],
"LCHColorSwatchTemplate" -> inputFormString @* Lookup[ "color" ],
"LUVColorSwatchTemplate" -> inputFormString @* Lookup[ "color" ],
"RGBColorSwatchTemplate" -> inputFormString @* Lookup[ "color" ],
"XYZColorSwatchTemplate" -> inputFormString @* Lookup[ "color" ]
|>;

(* ::**************************************************************************************************************:: *)
Expand Down

0 comments on commit 63ac922

Please sign in to comment.