1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-30 05:19:57 +00:00

Docs for colour-oklch operator

This commit is contained in:
Jeremy Ruston 2024-11-18 16:38:54 +00:00
parent 3507b0f952
commit 84bef54802

View File

@ -0,0 +1,33 @@
created: 20241117161528913
modified: 20241117161528913
tags: [[Filter Operators]] [[Colour Operators]]
title: colour-oklch Operator
caption: colour-oklch
op-purpose: manipulate colour values in the OKLCH colour space
op-input: a selection of colour values
op-suffix: "l", "c" or "h" to indicate which component of the colour to modify
op-parameter: value of the property to modify
op-output: the values of the modified colours
<<.from-version "5.3.7">> See [[Colour Palettes]] for background.
The <<.op colour-oklch>> operator is used to manipulate colour values in the [[OKLCH|https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/oklch]] colour space. The OKLCH colour space expresses colours as three numbers:
|!Id |!Name |!Range |
|l |Lightness |0 1 |
|c |Chroma |0 0.4 |
|h |Hue |0 360 |
The advantage of the OKLCH space is that it is perceptually uniform, meaning that equal changes in the numbers correspond to equal changes in the perceived colour.
For example, this filter expression will alter the lightness of the colour current page background colour to 0.1:
```
[function[colour],[page-background]colour-oklch:l[0.1]]
```
See also the following related operators:
* <<.olink colour-lighten>> to lighten a colour value
* <<.olink colour-darken>> to lighten a colour value