This repository has been archived on 2024-02-08. You can view files and clone it, but cannot push or open issues or pull requests.
frontend/src/helpers/color/randomColor.ts
kolaente 3f3d4b1682
Some checks failed
continuous-integration/drone/push Build is failing
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
2023-09-06 17:10:36 +02:00

21 lines
283 B
TypeScript

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)]
}