1
0

feat(labels): assign random color when creating labels

Resolves F-591
Related discussion: https://community.vikunja.io/t/assign-a-random-color-to-a-new-label/348/7
This commit is contained in:
kolaente
2023-09-06 17:10:36 +02:00
parent 9c46d064ac
commit 3f3d4b1682
2 changed files with 26 additions and 3 deletions

View File

@ -0,0 +1,20 @@
const COLORS = [
'#ffbe0b',
'#fd8a09',
'#fb5607',
'#ff006e',
'#efbdeb',
'#8338ec',
'#5f5ff6',
'#3a86ff',
'#4c91ff',
'#0ead69',
'#25be8b',
'#073b4c',
'#373f47',
]
export function getRandomColorHex(): string {
return COLORS[Math.floor(Math.random() * COLORS.length)]
}