referencing colors used in palette instead of using hex code?

78 views
Skip to first unread message

Justin Hurd

unread,
Jan 21, 2021, 11:08:02 PM1/21/21
to TiddlyWiki
Hello all,
I was wondering how I could go about referencing the colors used in the palette instead of using the colors hexcode, so I can have it change color shemes to match other palettes, like this:

<div class="left">
<details  open style="text-align: center; width: 100%; border-radius: 12px; background-color:<<colour page-background>>;">
...

but when I try this, it doesn't seem to work, so i was wondering if someone could help/explain why, or where I'm going wrong.

If possible, explaining like I'm 5 would help, because I'm not very familiar with the terms used for TW5 (I just  learned what transclusion meant haha)

any help is really appreciated!

TW Tones

unread,
Jan 22, 2021, 1:41:31 AM1/22/21
to TiddlyWiki
Justin,

This is because you can not concatinate text and the results of your macro  <<colour page-background>>  in the way you have. 

The resource I am developing is a reference work for all such tiddly wiki methods that will help a learner, but in this case you may specifically be interested the following;

Eg <htmltag attribute= is equivalent to <details open style=

<div class="left">
<$wikify name=styles text="text-align: center; width: 100%; border-radius: 12px; background-color:<<colour page-background>>;">
<details  open style=<<styles>> >

Content
</details>
</$wikify>
</div>

The above is one solution but you can use others to evaluate the variable and concatenate the variable.

The same rules apply to  Widgets as well. 

Another example is;
\define styles() text-align: center; width: 100%; border-radius: 12px; background-color:<<colour page-background>>;
<div class="left">
<$wikify name=styles text="<<styles>>">
<details  open style=<<styles>> >

Content
</details>
</$wikify>
</div>

Regards
Tones

Justin Hurd

unread,
Jan 22, 2021, 2:05:45 AM1/22/21
to TiddlyWiki
This is exactly what I was looking to do, thank you! I will admit I did have to google a word or two, but I think I understand how this functions, I'll have to read through your reference work as well, so I can get a better understanding of how this works.
Reply all
Reply to author
Forward
0 new messages