Check to see if it is a hex color
Regular expression for matching a hexcolor
$ npm install --save regex-hexcolor
const regexHex = require(regex-hexcolor); const fullHex = "#FFFFFF"; const hex = "#FFF"; regexHex.test(fullHex); regexHex.test(hex);
MIT © James Perkins