This commit is contained in:
2024-11-28 23:08:17 +01:00
parent 8895fde030
commit 0dda8e760c
16116 changed files with 2866428 additions and 71 deletions

19
node_modules/cssstyle/lib/utils/colorSpace.js generated vendored Normal file
View File

@@ -0,0 +1,19 @@
'use strict';
const MAX_HUE = 360;
const COLOR_NB = 12;
const MAX_RGB_VALUE = 255;
// https://www.w3.org/TR/css-color-4/#hsl-to-rgb
exports.hslToRgb = (hue, sat, light) => {
hue = hue % MAX_HUE;
if (hue < 0) {
hue += MAX_HUE;
}
function f(n) {
const k = (n + hue / (MAX_HUE / COLOR_NB)) % COLOR_NB;
const a = sat * Math.min(light, 1 - light);
return light - a * Math.max(-1, Math.min(k - 3, 9 - k, 1));
}
return [f(0), f(8), f(4)].map((value) => Math.round(value * MAX_RGB_VALUE));
};

View File

@@ -0,0 +1,14 @@
'use strict';
module.exports = function getBasicPropertyDescriptor(name) {
return {
set: function (v) {
this._setProperty(name, v);
},
get: function () {
return this.getPropertyValue(name);
},
enumerable: true,
configurable: true,
};
};