Color must be 6 hexa digit, by regex - Node.js CSS

Node.js examples for CSS:Color

Description

Color must be 6 hexa digit, by regex

Demo Code


// FIXME : Add more color format
function isValidColor(color) {
    return color.search(/^[0-9a-f]{6}$/i) > -1;
}

Related Tutorials