2014-02-20 10:00:38 +00:00
|
|
|
title: $:/snippets/currpalettepreview
|
|
|
|
|
2020-07-15 11:23:13 +00:00
|
|
|
\whitespace trim
|
2024-10-25 08:28:33 +00:00
|
|
|
|
2024-11-10 09:52:43 +00:00
|
|
|
\procedure colour-div-filtered(class,styleName,styleColour)
|
2024-11-14 17:40:58 +00:00
|
|
|
<!-- Note the join, needed to cope with palette entries containing spaces -->
|
2024-11-17 16:11:10 +00:00
|
|
|
\function colour(name) [<colour-palette>getindex<name>] :else[<colour-palette>get[palette-import]getindex<name>] :map[subfilter<currentTiddler>join[ ]]
|
2024-11-14 17:40:58 +00:00
|
|
|
<$let
|
|
|
|
colour-palette=<<currentTiddler>>
|
2024-11-17 14:45:41 +00:00
|
|
|
colour-result={{{ [function[colour],<styleColour>] }}}
|
2024-11-14 17:40:58 +00:00
|
|
|
>
|
|
|
|
<div class=<<class>> style={{{ [<styleName>addsuffix[:]addsuffix<colour-result>addsuffix[;]] }}}>
|
|
|
|
<$slot $name="ts-raw" $depth="2"/>
|
|
|
|
</div>
|
2024-11-10 09:52:43 +00:00
|
|
|
</$let>
|
|
|
|
\end colour-div-filtered
|
|
|
|
|
|
|
|
\procedure colour-div-wikified(class,styleName,styleColour)
|
|
|
|
<!-- Define our own deeply backwards compatible local versions of the colour macro -->
|
|
|
|
\define colour(name)
|
2024-11-07 18:30:39 +00:00
|
|
|
\whitespace trim
|
2024-11-10 09:52:43 +00:00
|
|
|
<$transclude tiddler=<<currentTiddler>> index="$name$">
|
|
|
|
<$transclude tiddler="$:/config/DefaultColourMappings/$name$"/>
|
2024-11-07 18:30:39 +00:00
|
|
|
</$transclude>
|
2024-10-25 08:28:33 +00:00
|
|
|
\end colour
|
2024-11-10 09:52:43 +00:00
|
|
|
\define color(name) <<colour $name$>>
|
2024-11-07 18:30:39 +00:00
|
|
|
<$wikify name="colour-result" text={{{ [[<<colour ]addsuffix<styleColour>addsuffix[>>]] }}} mode="inline">
|
|
|
|
<div class=<<class>> style={{{ [<styleName>addsuffix[:]addsuffix<colour-result>addsuffix[;]] }}}>
|
2024-11-10 09:52:43 +00:00
|
|
|
<$slot $name="ts-raw" $depth="2"/>
|
2024-11-07 18:30:39 +00:00
|
|
|
</div>
|
|
|
|
</$wikify>
|
2024-11-10 09:52:43 +00:00
|
|
|
\end colour-div-wikified
|
|
|
|
|
|
|
|
\widget $colour.div(class,styleName,styleColour)
|
|
|
|
<%if [<styleName>!match[]] %>
|
|
|
|
<%if [<currentTiddler>get[palette-type]match[modern]] %>
|
|
|
|
<$transclude $variable="colour-div-filtered" class=<<class>> styleName=<<styleName>> styleColour=<<styleColour>>/>
|
|
|
|
<%else%>
|
|
|
|
<$transclude $variable="colour-div-wikified" class=<<class>> styleName=<<styleName>> styleColour=<<styleColour>>/>
|
|
|
|
<%endif%>
|
2024-11-07 18:30:39 +00:00
|
|
|
<%else%>
|
|
|
|
<div class=<<class>>>
|
|
|
|
<$slot $name="ts-raw"/>
|
|
|
|
</div>
|
|
|
|
<%endif%>
|
|
|
|
\end $colour.div
|
|
|
|
|
2024-11-17 14:45:41 +00:00
|
|
|
\procedure palette-preview-component-list(tag)
|
|
|
|
<$list filter="[all[shadows+tiddlers]tag<tag>!has[draft.of]]" variable="componentTitle">
|
|
|
|
<$transclude $tiddler=<<componentTitle>> title=<<title>>/>
|
|
|
|
</$list>
|
|
|
|
\end palette-preview-component-list
|
|
|
|
|
2024-10-25 08:28:33 +00:00
|
|
|
\procedure palette-preview-thumbnail()
|
2024-11-07 18:30:39 +00:00
|
|
|
<$colour.div class="tc-palette-preview-thumbnail" styleName="background-color" styleColour="page-background">
|
2024-11-17 14:45:41 +00:00
|
|
|
<<palette-preview-component-list "$:/tags/Preview/Page">>
|
2024-11-07 18:30:39 +00:00
|
|
|
</$colour.div>
|
2024-10-25 08:28:33 +00:00
|
|
|
\end palette-preview-thumbnail
|
|
|
|
|
|
|
|
<<palette-preview-thumbnail>>
|