mirror of
https://github.com/zadam/trilium.git
synced 2025-11-10 23:35:50 +01:00
chore(react):start porting note map
This commit is contained in:
6
apps/client/src/widgets/note_map/utils.ts
Normal file
6
apps/client/src/widgets/note_map/utils.ts
Normal 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("")}`;
|
||||
}
|
||||
Reference in New Issue
Block a user