UNPKG

@thi.ng/checks

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