I am working on painting line, I faced a basic problem with changing the color :S:S
I have the following code, I got an error in the last line of code I cant add argument to new Color(???) >> I cant add the R, G, B color numbers
Paint paint = new Paint();
Random random = new Random();
int R = (int)(Math.random()*256);
int G = (int)(Math.random()*256);
int B= (int)(Math.random()*256);
paint.setColor(new Color(R , G , B));
You can’t create a
Colorobject like that.Coloris just a static Android helper class that handles color-based operations.Try this:
For reference, see the
Color.rgb(...)method.