hey all,
am a bit stuck here. basically would like to return the color object so am I right in thinking this is just the rgb values? If not then what would the return type be in the method? i.e. in this case I have put int for the rgb values
Also, what would be the syntax of returning the final three integers, seem to only be able to put one i.e. r in this case and not r,g,b?
package Chapter4;
import java.awt.*;
import java.util.Random;
public class RandomColor {
public int randomcolor(int r, int g, int b){
return r;
}
public static void main (String []args){
RandomColor pickcolor = new RandomColor();
Random generator = new Random();
int num1 = generator.nextInt(255);
int num2 = generator.nextInt(255);
int num3 = generator.nextInt(255);
int randcolor = pickcolor.randomcolor(num1, num2, num3);
System.out.println(randcolor);
}
}