for (int i = 0; i < c.length; i++)
{
for(int j=0; j
maybe something like this?
import java.util.*;
color[][] c = new color [10][2];
void setup() {
for (int i = 0; i < c.length; i++) {
for (int j = 0; j < c[0].length; j++) {
c[i][j] = color(random(255), random(255), random(255));
}
}
float[] reds = new float[c.length*c[0].length];
for (int i = 0; i < reds.length; i++) {
if ( i < c.length)
reds[i] = red(c[i][0]);
else
reds[i]=red(c[i-c.length][1]);
}
println("\n unsorted red values");
println(reds);
Arrays.sort(reds);
println("\nSORTED");
println(reds);
println("\n\n the bigger red value is: " + reds[reds.length-1]);
println("\n the 2nd bigger red value is: " + reds[reds.length-2]);
println("\n the smaller red value is: " + reds[0]);
println("\n\n cheers");
}