UNPKG

185 BJavaScriptView Raw
1import { isString } from "./is-string.js";
2const RE = /^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i;
3const isHexColor = (x) => isString(x) && RE.test(x);
4export {
5 isHexColor
6};