code: function num2hex(triplet) {
          var hex_alphabets = "0123456789ABCDEF";
          var hex = "#";
          var int1, int2;
          for (var i = 0; i < 3; i++) {
              int1 = triplet[i] / 16;
              int2 = triplet[i] % 16;
  
              hex += hex_alphabets.charAt(int1) + hex_alphabets.charAt(int2);
          }
          return hex;
      }
docs: Give a array with three values as the argument and the function will return the corresponding hex triplet.