chore: format

This commit is contained in:
2025-10-10 16:43:21 +02:00
parent f0aabd63b6
commit 75c29e0ba4
551 changed files with 433948 additions and 94145 deletions

View File

@@ -1,19 +1,19 @@
function isDark(color) {
var r = color.r;
var g = color.g;
var b = color.b;
var r = color.r;
var g = color.g;
var b = color.b;
// Using the HSP value, determine whether the color is light or dark
var colorArray = [r, g, b].map((v) => {
if (v <= 0.03928) {
return v / 12.92;
}
// Using the HSP value, determine whether the color is light or dark
var colorArray = [r, g , b ].map(v => {
if (v <= 0.03928) {
return v / 12.92
}
return Math.pow((v + 0.055) / 1.055, 2.4);
});
return Math.pow((v + 0.055) / 1.055, 2.4)
})
var luminance =
0.2126 * colorArray[0] + 0.7152 * colorArray[1] + 0.0722 * colorArray[2];
var luminance = 0.2126 * colorArray[0] + 0.7152 * colorArray[1] + 0.0722 * colorArray[2]
return luminance <= 0.179
}
return luminance <= 0.179;
}