Get random HTML color - Node.js CSS

Node.js examples for CSS:Color

Description

Get random HTML color

Demo Code

/**//from w ww .ja v a2s . c  om
 * Get random HTML color
 */
function get_random_color() {
    var letters = '0123456789ABCDEF'.split('');
    var color = '#';
    for (var i = 0; i < 6; i++) {
        color += letters[Math.round(Math.random() * 15)];
    }
    return color;
}

Related Tutorials