chore(react):start porting note map

This commit is contained in:
Elian Doran
2025-10-04 11:07:16 +03:00
parent 08fae19d19
commit b41042fec4
5 changed files with 115 additions and 96 deletions

View File

@@ -0,0 +1,6 @@
export function rgb2hex(rgb: string) {
return `#${(rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/) || [])
.slice(1)
.map((n) => parseInt(n, 10).toString(16).padStart(2, "0"))
.join("")}`;
}