function isHexColor(val) {
    const regExp = /^#([0-9A-Fa-f]{3}){1,2}$/;
    return typeof val === "string" && regExp.test(val);
  }
Validate if html hex color presentation

@param val
@returns {*|boolean}