feat: some shit

This commit is contained in:
2024-04-03 14:27:48 +02:00
parent d4128840b9
commit 93baa3b6b0
67 changed files with 2513 additions and 703 deletions

14
src/helpers/colors.ts Normal file
View File

@@ -0,0 +1,14 @@
// function to turn css rgb() strings to hex
export function rgbToHex(rgb: string) {
let hex = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
if (!hex) return rgb;
return (
"#" +
hex
.slice(1)
.map((x) => {
return ("0" + parseInt(x).toString(16)).slice(-2);
})
.join("")
);
}