1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-04-17 00:03:14 +00:00

Add colour-set-alpha operator

This commit is contained in:
Jeremy Ruston 2025-03-07 16:23:00 +00:00
parent ee977def52
commit d42e3d36bc
2 changed files with 7 additions and 0 deletions

View File

@ -40,6 +40,11 @@ exports["colour-set-oklch"] = makeSerialColourOperator(function (colour, operato
return colour.display().toString();
});
exports["colour-set-alpha"] = makeSerialColourOperator(function (colour, operator, options) {
colour.alpha = $tw.utils.parseNumber(operator.operand);
return colour.display().toString();
});
exports["colour-contrast"] = makeParallelColourOperator(function (colours, operator, options) {
var colourContrasts = [];
$tw.utils.each(colours,function(colour,index) {

View File

@ -24,6 +24,7 @@ modified: 20250204130756749
* [[colour-contrast Operator]]
* [[colour-best-contrast Operator]]
* [[colour-interpolate Operator]]
* [[colour-set-alpha Operator]]
! Other Features Included in this PR
@ -38,6 +39,7 @@ The following features are required for the new colour handling system, but are
The code for the palette compilation process can be found in $:/core/macros/CSS. The following tiddlers are generated by the compilation process:
* $:/palette is the current palette tiddler
* $:/temp/palette-consolidated is the result of merging the current palette with the chain of imported palettes. The palette entries are the raw values such as `<<colour background>>`, not the computed colours
* $:/temp/palette-colours is the result of computing the colours for the current palette. The palette entries are CSS colour values that can be used directly