convertRgbToHex = ([r, g, b]) => {
  // combine the octets into a 32-bit integer as: [1][r][g][b]
  const hexNumber =
    // operator precedence is (+) > (<<) > (|)
    ((((256 + // [1][0]
      r) << // [1][r]
      8) | // [1][r][0]
      g) << // [1][r][g]
      8) | // [1][r][g][0]
    b;
  // serialize [1][r][g][b] to a hex string, and
  // remove the 1 to get the number with 0s intact
  return '#' + hexNumber.toString(16).slice(1).toUpperCase();
}
Convert [r, g, b] to #rrggbb.

@see https://gist.github.com/983535

@example
rgb2hex([255, 255, 255]) // '#ffffff'

@author Jed Schmidt

@param {ReadonlyArray<number>} param0
@returns {string}