This is a stripped-down version of a single section of Grok TiddlyWiki, optimized for fast loading and readability by search engines. Some features are missing.

For the full Grok TiddlyWiki experience, please visit the wiki version of this page.

Ex:PaletteInvestigation/answer

18th April 2021 at 10:20am

The macro definition is found in $:/core/macros/CSS. (If you're American and don't appreciate the spelling colour, notice there is a color macro too that just calls colour!). The macro transcludes the tiddler named in $:/palette with this bit:

<$transclude tiddler={{$:/palette}} index="$name$">

$:/palette is a configuration tiddler managed by TiddlyWiki that contains the name of whichever palette you've currently selected in the control panel. If you then open up the palette named therein (e.g., $:/palettes/GruvboxDark), you'll see a data tiddler listing the names of colors and their CSS values (or, sometimes, another substitution with the <<colour>> macro).

In the macro definition, you might wonder what's with all the other $transclude widgets:

<$transclude tiddler={{$:/palette}} index="$name$">
  <$transclude tiddler="$:/palettes/Vanilla" index="$name$">
    <$transclude tiddler="$:/config/DefaultColourMappings/$name$"/>
  </$transclude>
</$transclude>

In case the $transclude widget is not able to transclude the tiddler for some reason (e.g., it doesn't exist), then the contents of the widget are used as a fallback (more on this in Hiding and Showing Things). So if the palette isn't set, then the Vanilla palette is used, and if that's gone as well for some reason, a set of default mappings are used.

Go to question: Ex:PaletteInvestigation