1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-01 07:36:18 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers/macros/ContrastColourMacro.tid

22 lines
747 B
Plaintext
Raw Normal View History

created: 20150221113728000
modified: 20150221151338000
tags: Macros [[Core Macros]]
title: contrastcolour Macro
type: text/vnd.tiddlywiki
caption: contrastcolour
The <<.def contrastcolour>> [[macro|Macros]] returns whichever of two given [[CSS|Cascading Style Sheets]] colours is deemed to contrast best with another.
An example can be seen in the [[template tiddler for tag pills|$:/core/ui/TagTemplate]].
!! Parameters
;target
: The colour to contrast against (typically a background colour)
;fallbackTarget
: An alternative colour to contrast against. This is used when <<.param target>> is undefined or not a valid colour
;colourA
: The first of the two colours to choose between
;colourB
: The second of the two colours to choose between