scripts/tools/findLargestSpacesInRGB.js
// create new RGB color with the largest possible distance from all other rgbColors
create new RGB color with the largest possible distance from all other rgbColors
create new RGB color with the largest possible distance from all other rgbColors
function findLargestSpaceInRGB(rgbColors) {
  const rgb = [0, 0, 0];
  let largestDistance = 0;
  for (let i = 0; i < 256; i+=4) {
    for (let j = 0; j < 256; j+=4) {
      for (let k = 0; k < 256; k+=4) {
        const distance = calculateDistance(i, j, k, rgbColors);
        if (distance > largestDistance) {
          largestDistance = distance;
          rgb[0] = i;
          rgb[1] = j;
          rgb[2] = k;
        }
      }
    }
  }
  return rgb;
}
function findLargestSpaceInRGB ( rgbColors ) { const rgb = [ 0 , 0 , 0 ] ; let largestDistance = 0 ; for ( let i = 0 ; i < 256 ; i += 4 ) { for ( let j = 0 ; j < 256 ; j += 4 ) { for ( let k = 0 ; k < 256 ; k += 4 ) { const distance = calculateDistance ( i , j , k , rgbColors ) ; if ( distance > largestDistance ) { largestDistance = distance ; rgb [ 0 ] = i ; rgb [ 1 ] = j ; rgb [ 2 ] = k ; } } } } return rgb ; }
create new RGB color with the largest possible distance from all other rgbColors
create new RGB color with the largest possible distance from all other rgbColors