<commit_before><commit_msg>Added creation of HUE image for HUEmediate<commit_after><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>HUE Image</title>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width" />
  </head>
  <body>
    <script type="text/javascript" >
      function GetUrlValue(VarSearch) {
        var SearchString = window.location.search.substring(1);
        var VariableArray = SearchString.split('&');
        for (var i = 0; i < VariableArray.length; i++) {
          var KeyValuePair = VariableArray[i].split('=');
          if (KeyValuePair[0] == VarSearch) {
            return KeyValuePair[1];
          }
        }
      }
      
      function HueImageRedraw() {
        var HueCanvas = document.getElementById("HUECanvas");
        var HueContext = document.getElementById("HUECanvas").getContext("2d");
        var size=GetUrlValue('size');
        if (size != undefined)
          HueCanvas.width = size;
        else HueCanvas.width = 512;
        HueCanvas.height = HueCanvas.width;
        var xhalf = HueCanvas.width / 2;
        var yhalf = HueCanvas.height / 2;
        HueContext.fillRect(0, 0, HueCanvas.width, HueCanvas.height); // Need to Fill Canvas otherwise its unable to be modified...
        HueImagedata = HueContext.getImageData(0, 0, HueCanvas.width, HueCanvas.height);
        for (var y = 0; y < HueCanvas.height; y++) { // Evey ScanLine
          for (var x = 0; x < HueCanvas.width; x++) { // Every Pixel on ScanLine
            var px = (x - xhalf) / xhalf; // [-1, 1]
            var py = (y - yhalf) / yhalf; // [-1, 1]
            var Hue = 360 - (Math.atan2(px, py) * 180 / Math.PI + 180); // [0..359]
            var Brightness = 1;
            var Saturation = 1;
            if (Math.sqrt(px * px + py * py) < 0.5) // Inner Circle
              Saturation = 2 * Math.sqrt(px * px + py * py);
            if (Math.sqrt(px * px + py * py) > 0.5) // Outer Circle
              Brightness = 1 - 2 * (Math.sqrt(px * px + py * py) - 0.5);
            if (Math.sqrt(px * px + py * py) > 1) // Rest Of Square Outside Outer Circle
              Brightness = 0;
            ////// Convert HSB to RGB
            if (Saturation === 0) {
              var Red = Brightness;
              var Green = Brightness;
              var Blue = Brightness;
            } else
            {
              var Sector = Math.floor(Hue / 60);
              var Fraction = (Hue / 60) - Sector;
              var p = Brightness * (1 - Saturation);
              var q = Brightness * (1 - Saturation * Fraction);
              var t = Brightness * (1 - Saturation * (1 - Fraction));
              switch (Sector) {
                case 0:
                  Red = Brightness;
                  Green = t;
                  Blue = p;
                  break;
                case 1:
                  Red = q;
                  Green = Brightness;
                  Blue = p;
                  break;
                case 2:
                  Red = p;
                  Green = Brightness;
                  Blue = t;
                  break;
                case 3:
                  Red = p;
                  Green = q;
                  Blue = Brightness;
                  break;
                case 4:
                  Red = t;
                  Green = p;
                  Blue = Brightness;
                  break;
                default: // case 5:
                  Red = Brightness;
                  Green = p;
                  Blue = q;
                  break;
              }
            }
            //////
            var Index = (x + y * HueCanvas.width) * 4; // Index of Pixel
            HueImagedata.data[Index + 0] = Red * 255;
            HueImagedata.data[Index + 1] = Green * 255;
            HueImagedata.data[Index + 2] = Blue * 255;
          }
        }
        HueContext.putImageData(HueImagedata, 0, 0);
        document.getElementById('HueImage').src = HueCanvas.toDataURL();
      }

      window.onload = function() {
        window.onresize();
      };

      window.onresize = function() {
        HueImageRedraw();
      };

    </script>
    <div align="center">
      <canvas style="border:1px solid #884422;display:none;" id="HUECanvas" width=256 height=256 >It seems your device doesn"t support the required HTML5 Canvas</canvas>
      <img id="HueImage">
    </div>

  </body>
</html>
{'fraction_non_alphanumeric': 0.12491723681306555, 'fraction_numerical': 0.022732288677996027, 'mean_word_length': 1.379002624671916, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 1}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4183220', 'n_tokens_mistral': 1437, 'n_tokens_neox': 1320, 'n_words': 349}