Is it possible to highlight HTML color codes?

57 views
Skip to first unread message

talha131

unread,
Jun 29, 2018, 10:14:04 AM6/29/18
to TiddlyWiki
Hi all,

I want HTML color codes in my tiddly wiki to be highlighted? Something like in the following screenshot.


How can I get this working, if it is possible at all?

Thank you.

Mohammad

unread,
Jun 29, 2018, 11:23:07 AM6/29/18
to TiddlyWiki
Take a look here:


You can write a small macro to create such a list! It is easy in Tiddlywiki to do that!

/Mohammad

Mohammad

unread,
Jun 29, 2018, 12:12:32 PM6/29/18
to tiddl...@googlegroups.com
You may try this macro

  • Code

\define colors(color:"black", txtcolor:"", bgcolor:"")
<span style="font-size:0.9em;color:$color$;">&#9632;
  <span style="color:$txtcolor$;background-color:$bgcolor$;">
  $color$</span>
</span>
\end

Put it in a tiddler tagged with $:/tags/Macro and name it what you like!

  •  Example
* <<colors "blue">>
* <<colors "peru">>
* <<colors "teal">>
* <<colors "#bada55" "black" "#bada55">>
* <<colors "#000000" "white" "black">>
* <<colors "deeppink">>
  • Output



/Mohammad

talha131

unread,
Jun 29, 2018, 1:34:00 PM6/29/18
to TiddlyWiki
I tried your tip regarding Showroom tilder

@@border-radius: 5px;
@@padding: 9px 12px 10px;
@@margin:1em;
@@background-color:#2b2b2b;
`#2b2b2b`
@@

and it worked flawlessly. I wasn't aware of macro feature present in TiddlyWiki.

But the custom macro you created for me is more versatile and succinct. I am going to use it.

Thanks a lot for both your responses. Really appreciated.


Reply all
Reply to author
Forward
0 new messages