docs: function grayscaleFactor(color) {
    // Calculate S from HLS
    var r = color[0];
    var g = color[1];
    var b = color[2];
  
    var st = 0;
    if (r + g + b != 0) {
      var min = Math.min(r, g, b) / 255;
      var max = Math.max(r, g, b) / 255;
      if (min + max < 1) {
        st = (max - min) / (max + min);
      } else {
        st = (max - min) / (2.0 - max - min);
      }
    }
  
    // scale and offset - we don't need zero values
    return st * 0.5 + 0.5;
  }