So I'm trying to write a simple function that returns a random set of colors as an array. I feel like I've boffed some simple syntax here, but I can't see it. It is giving me the error 'This method must return a result of type int[]'. Here's the function and the color variables declared before the setup. Can anyone point out what I'm doing wrong here?
int cyan = color(0,174,239,128);
int yellow = color(255,242,0,128);
int magenta = color(236,0,140,128);
int[] randomPermutation() {
float permutationNumber = random(6);
if (permutationNumber > 5 && permutationNumber < 6) {
int permutation[] = {cyan,magenta,yellow};
return permutation;
}
if (permutationNumber > 4 && permutationNumber < 5) {
int permutation[] = {cyan,yellow,magenta};
return permutation;
}
if (permutationNumber > 3 && permutationNumber < 4) {
int permutation[] = {magenta,cyan,yellow};
return permutation;
}
if (permutationNumber > 2 && permutationNumber < 3) {
int permutation[] = {magenta,yellow,cyan};
return permutation;
}
if (permutationNumber > 1 && permutationNumber < 2) {
int permutation[] = {yellow,cyan,magenta};
return permutation;
}
if (permutationNumber > 0 && permutationNumber < 1) {
int permutation[] = {yellow,magenta,cyan};
return permutation;
}
}