mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-24 16:06:58 +00:00
Add a primitive custom palette editor
This commit is contained in:
parent
b90b449ceb
commit
c02c82557b
@ -5,6 +5,7 @@ tags: $:/tags/Palette
|
||||
type: application/x-tiddler-dictionary
|
||||
color-scheme: light
|
||||
palette-type: modern
|
||||
editor: $:/palette-editors/TwentyTwenties
|
||||
|
||||
# Background and foreground colours, which are interpolated as required
|
||||
base-paper: #FCFFF0
|
||||
|
18
core/palette-templates/TwentyTwentiesEditor.tid
Normal file
18
core/palette-templates/TwentyTwentiesEditor.tid
Normal file
@ -0,0 +1,18 @@
|
||||
title: $:/palette-editors/TwentyTwenties
|
||||
|
||||
\procedure actionsRecompilePalette()
|
||||
<$transclude $variable="actions-compile-palette" inputTitle={{$:/palette}} outputTitle="$:/temp/palette-colours"/>
|
||||
\end actionsRecompilePalette
|
||||
|
||||
paper: <$edit-text tiddler={{$:/palette}} index="base-paper" type="color" tag="input" inputActions=<<actionsRecompilePalette>>/>
|
||||
|
||||
background: <$edit-text tiddler={{$:/palette}} index="base-background" type="color" tag="input" inputActions=<<actionsRecompilePalette>>/>
|
||||
|
||||
ink: <$edit-text tiddler={{$:/palette}} index="base-ink" type="color" tag="input" inputActions=<<actionsRecompilePalette>>/>
|
||||
|
||||
primary: <$edit-text tiddler={{$:/palette}} index="base-primary" type="color" tag="input" inputActions=<<actionsRecompilePalette>>/>
|
||||
|
||||
secondary: <$edit-text tiddler={{$:/palette}} index="base-secondary" type="color" tag="input" inputActions=<<actionsRecompilePalette>>/>
|
||||
|
||||
tertiary: <$edit-text tiddler={{$:/palette}} index="base-tertiary" type="color" tag="input" inputActions=<<actionsRecompilePalette>>/>
|
||||
|
@ -6,6 +6,12 @@ caption: {{$:/language/ControlPanel/Palette/Caption}}
|
||||
|
||||
{{$:/snippets/paletteswitcher}}
|
||||
|
||||
<$let paletteEditor={{{ [{$:/palette}get[editor]] :else[{$:/palette}get[palette-import]!match[]get[editor]] }}}>
|
||||
<%if [<paletteEditor>!match[]] %>
|
||||
<$transclude $tiddler=<<paletteEditor>> $mode="block"/>
|
||||
<%endif%>
|
||||
</$let>
|
||||
|
||||
<$reveal type="nomatch" state="$:/state/ShowPaletteEditor" text="yes">
|
||||
|
||||
<$button set="$:/state/ShowPaletteEditor" setTo="yes"><<lingo ShowEditor/Caption>></$button>
|
||||
|
Loading…
Reference in New Issue
Block a user