code: function rgbToHex(r, g, b, force6Char) {
          function pad(c) {
              return c.length == 1 ? '0' + c : '' + c;
          }
  
          var hex = [
              pad(mathRound(r).toString(16)),
              pad(mathRound(g).toString(16)),
              pad(mathRound(b).toString(16))
          ];
  
          // Return a 3 character hex if possible
          if (!force6Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {
              return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
          }
  
          return hex.join("");
      }
docs: `rgbToHex` Converts an RGB color to hex Assumes r, g, and b are contained in the set [0, 255] Returns a 3 or 6 character hex