import chalk from "chalk" ; export const chalkColors = [ "greenBright" , "yellowBright" , "magentaBright" , "cyanBright" , "whiteBright" , "redBright" , "blueBright" , "green" , "yellow" , "magenta" , "cyan" , "white" , "red" , "redBright" , ] ; let currentColorIndex = 0 ; param { string } str returns { string } export const applyRandomColor = ( str ) : string => { const randomColor = chalkColors [ currentColorIndex ] ; currentColorIndex = currentColorIndex === chalkColors . length - 1 ? 0 : currentColorIndex + 1 ; return ( chalk as any ) [ randomColor ] ( str ) ; } ;