On Monday, July 24, 2017 at 6:57:39 PM UTC-7, Rustem wrote:
>
> I have these macros defined
>
... 

> It works if I specify the color directly
> <$vars _c=red><<cn>></$vars>
>
> But how do I specify the color using a macro? This doesn't work:
> <$vars _c=<<color tiddler-background>>><<cn>></$vars>
>
>  
The problem with using the <<color>> macro as a parameter value in the 
<$vars> widget is that the macro doesn't return a color value directly. 
 Instead, it returns transclusion widgets that, if subsequently rendered, 
results in a color value.  Here's the core definitions (from 
$:/core/macros/CSS):

\define colour(name)
<$transclude tiddler={{$:/palette}} index="$name$"><$transclude tiddler="$:/
palettes/Vanilla" index="$name$"/></$transclude>
\end

\define color(name)
<<colour $name$>>
\end

To retrieve the actual color *value*, you can use the <$wikify> widget, 
which "captures" the rendered output from the macro and stores that in a 
variable, like this:

<$wikify name="_c" text=<<colour tiddler-background>>><<cn>></$wikify>

Note: in this example, "tiddler-background" produces "invisible" text, 
since the foreground text color is the same as the background tiddler 
color.  I assume that was your intention.

Let me know how it goes.

enjoy,
-e
Eric Shulman
TiddlyTools.com: "Small Tools for Big Ideas!" (tm)
InsideTiddlyWiki: The Missing Manuals

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/d542d1c4-762a-4c3c-a23f-1919d86a0a33%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to