code: function rgbToHsl(r, g, b) {
      [r, g, b] = [limit(r, 0, 255) / 255, limit(g, 0, 255) / 255, limit(b, 0, 255) / 255];
  
      const max = Math.max(r, g, b),
          min = Math.min(r, g, b);
      let h, s, l = (max + min) / 2;
  
      if (max == min) {
          h = s = 0; // achromatic
      } else {
          const d = max - min;
          s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
  
          switch (max) {
              case r:
                  h = ((g - b) / d) + (g < b ? 6 : 0);
                  break;
              case g:
                  h = ((b - r) / d) + 2;
                  break;
              case b:
                  h = ((r - g) / d) + 4;
                  break;
          }
  
          h /= 6;
      }
  
      return [h * 360, s * 100, l * 100].map(Math.round);
  }
docs: Converte da RGB a HSL.
  @see https://gist.github.com/mjackson/5311256
  
  @param      {number}  r       rosso 0-255
  @param      {number}  g       veerde 0-255
  @param      {number}  b       blu 0-255
  @return     {Array}   un array con H(0-360) S(0-100) L(0-100)