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:
20
src/helpers/color/randomColor.ts
Normal file
20
src/helpers/color/randomColor.ts
Normal 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)]
|
||||
}
|
Reference in New Issue
Block a user