[web] Lint source code

This commit is contained in:
Alain Nussbaumer
2024-03-23 01:53:25 +01:00
parent 9b12618b93
commit 152891f6cd
4 changed files with 38 additions and 61 deletions

View File

@@ -6,16 +6,12 @@ const toColor = (string) => {
return (hash & 0x00ffffff).toString(16)
}
const luminance = (color) => {
return (
[0.2126, 0.7152, 0.0722].reduce(
(luminance, factor, index) =>
luminance +
Number('0x' + color.slice(index * 2, index * 2 + 2)) * factor,
0
) / 255
)
}
const luminance = (color) =>
[0.2126, 0.7152, 0.0722].reduce(
(luminance, factor, index) =>
luminance + Number(`0x${color.slice(index * 2, index * 2 + 2)}`) * factor,
0
) / 255
export const renderSVG = (data) => {
const color = toColor(data.alternate),