mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-23 15:36:52 +00:00
Refactor for clearer variable names
This commit is contained in:
parent
5a6eea7fa2
commit
b1fcb18d9e
@ -14,20 +14,20 @@ Filter operators for colour operations
|
|||||||
|
|
||||||
var Color = require("$:/core/modules/utils/dom/color.js").Color;
|
var Color = require("$:/core/modules/utils/dom/color.js").Color;
|
||||||
|
|
||||||
exports["colour-lighten"] = makeSerialColourOperator(function (c, operator, options) {
|
exports["colour-lighten"] = makeSerialColourOperator(function (colour, operator, options) {
|
||||||
return c.lighten($tw.utils.parseNumber(operator.operand));
|
return colour.lighten($tw.utils.parseNumber(operator.operand));
|
||||||
});
|
});
|
||||||
|
|
||||||
exports["colour-darken"] = makeSerialColourOperator(function (c, operator, options) {
|
exports["colour-darken"] = makeSerialColourOperator(function (colour, operator, options) {
|
||||||
return c.darken($tw.utils.parseNumber(operator.operand));
|
return colour.darken($tw.utils.parseNumber(operator.operand));
|
||||||
});
|
});
|
||||||
|
|
||||||
exports["colour-oklch"] = makeSerialColourOperator(function (c, operator, options) {
|
exports["colour-oklch"] = makeSerialColourOperator(function (colour, operator, options) {
|
||||||
var prop = ((operator.suffixes || [])[0] || ["l"])[0];
|
var prop = ((operator.suffixes || [])[0] || ["l"])[0];
|
||||||
if(["l","c","h"].indexOf(prop) !== -1) {
|
if(["l","c","h"].indexOf(prop) !== -1) {
|
||||||
c.oklch[prop] = $tw.utils.parseNumber(operator.operand);
|
colour.oklch[prop] = $tw.utils.parseNumber(operator.operand);
|
||||||
}
|
}
|
||||||
return c;
|
return colour;
|
||||||
});
|
});
|
||||||
|
|
||||||
exports["colour-contrast"] = makeParallelColourOperator(function (colours, operator, options) {
|
exports["colour-contrast"] = makeParallelColourOperator(function (colours, operator, options) {
|
||||||
|
Loading…
Reference in New Issue
Block a user