import randomColor from 'randomcolor' ; type ColorMode = 'dark' | 'bright' | 'light' | 'random' ; param seed export function getRandomColor ( seed , luminosity = 'dark' ) { return randomColor ( { luminosity , seed , } ) ; } type Cache = { [ key ] : string ; } ; const cache = { } ; param seed param luminosity export function getPerRandomColor ( seed , luminosity = 'dark' ) { if ( cache [ seed ] ) { return cache [ seed ] ; } cache [ seed ] = randomColor ( { luminosity } ) ; return cache [ seed ] ; }