I’m creating a widget and trying to pass to it a macro value: <$mywidget foreground=<<colour foreground>> >. Inside the widget javascript what I get is the transclude string, not the color ("<$transclude tiddler={{$:/palette}} index=“foreground”><$transclude tiddler="$:/palettes/Vanilla" index=“foreground”><$transclude tiddler="$:/config/DefaultColourMappings/foreground"/></$transclude></$transclude>")
How can I “execute” the value so I get the actual color string?
interesting, sorry i don’t have a solution - usually what i see people suggesting is to put it in a <$let> widget to evaluate it before it gets to your widget, but
When using a macro as the value of a widget parameter, it is not “wikified” (aka, “evaluated”). Except for replacing any $param$ or $(variable)$ references contained within the macro definition, the full text of the macro definition is passed along as the value of the widget parameter. Thus, using <$let clr=<<colour foreground>>> will have the same problem as described in the OP.
To “capture” the evaluated output of a macro into a variable and then pass the resulting output as a parameter value in another widget, you can use the $wikify widget, like this: