I am making a timer and i want it to be a specific gray color:
However. the numbers show up with a weird, unsightly white outline:
What can I do? Am I doing something wrong when setting the color?
It's not just gray, any color does this, except white.
public void update(int timeSpent)
{
GreenfootImage img = getImage();
img.clear();
Color gray = new Color(333333);
img.setColor(gray);
img.setFont(new Font("Times New Roman", Font.PLAIN, fontSize));
String t = String.valueOf(timeSpent);
digitNumber=t.length();
img.drawString(t, (834-768)/2-fontSize*(digitNumber)/2, 20);
}
What can I do? Am I doing something wrong when setting the color?
It's not just gray, any color does this, except white.


I don't see this problem here. I can't test it with this line 5 though in the new version.
Try it with setting a background and then (lines 10+11) and then write your numbers on it and report back if anything changed.
(Not that it would matter, but I don't really understand your calculation for the x-position.)