From cd5bbcda8d30831e61cb7a6db5b0a1f47fc139c5 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Mon, 18 Nov 2024 18:15:53 +0000 Subject: [PATCH] Add contrast checks to TwentyTwenties palette I think I might be building a programming language for writing palettes... --- core/palette-templates/TwentyTwenties.tid | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/palette-templates/TwentyTwenties.tid b/core/palette-templates/TwentyTwenties.tid index 4260e3611..1bc7735c3 100644 --- a/core/palette-templates/TwentyTwenties.tid +++ b/core/palette-templates/TwentyTwenties.tid @@ -17,6 +17,10 @@ base-secondary: rgb(236, 212, 58) # Tertiary base colour, used for monospaced text and other tertiary elements base-tertiary: rgb(135, 239, 70) +# Contrast tests +?background-foreground-contrast: [function[colour],[background]] [function[colour],[base-background]] +[colour-contrast:DeltaPhi[]compare:number:gt[25]then[ok]else[Foreground/background contrast is too low]] + +# Colour definitions alert-background: [function[colour],[base-secondary]colour-oklch:l[0.9]] alert-border: [function[colour],[base-secondary]colour-oklch:l[0.5]] alert-highlight: [function[colour],[base-primary]colour-oklch:l[0.6]]