docs: function hex(s) {
      var m = /rgba?\((\d+), (\d+), (\d+)/.exec(s),
        c = s.split("");
      if (m) {
        s = ( m[1] << 16 | m[2] << 8 | m[3] ).toString(16);
        while (s.length < 6)
          s = "0" + s;
      }
      return "#" + (s.length == 6 ? s : c[1] + c[1] + c[2] + c[2] + c[3] + c[3]);
    }