I am not sure why this is showing an error on greenfoot.It says this is an incompatible type. How to fix it , as shown here
Asked
Active
Viewed 57 times
-2
-
3Please add the code you are having issues with to the question as text. – Mark Mucha Nov 26 '17 at 19:29
1 Answers
0
In last version of Greenfoot there is a special class Color. It interferes with awt class Color with the same name. Use the Greenfoot's class Color in your code. For example:
public MyWorld()
{
super(600, 400, 1);
GreenfootImage bgr = getBackground();
int r = (int)(0.8f * 255);
int g = (int)(0.95f * 255);
int b = (int)(1.0f * 255);
int a = (int)(1.0f * 255);
Color bgrColor = new Color(r, g, b, a);
bgr.setColor(bgrColor);
bgr.fill();
}

akostyurin
- 1
- 1