randomColor()

// ⭐️ examples:
//    • randomColor()
//    • randomColor(0.5)         // random color with alpha = 0.5
export function randomColor(alpha) {

    const [r,g,b] = [
        randomInt(0,255), 
        randomInt(0,255), 
        randomInt(0,255)
    ];
    
    return `rgb(${r} ${g} ${b}${alpha >=0 ? ` / ${alpha}` : ''})`;
}

Last updated