1 import { ACCENT_COLORS } from '@proton/shared/lib/colors'
2 import tinycolor from 'tinycolor2'
4 export const ACCENT_COLORS_IN_HSL = ACCENT_COLORS.map((color) => tinycolor(color).toHslString())
6 export function getAccentColorForUsername(name: string) {
7 const factor = name.split('').reduce((acc, char) => acc + char.charCodeAt(0), 0)
8 const index = factor % ACCENT_COLORS_IN_HSL.length
9 const color = ACCENT_COLORS_IN_HSL[index]