十六进制颜色值的正则表达式

    let colorHex = "#FF00FF";
    const reg = /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;
    alert(reg.test(colorHex))