dimanche 28 décembre 2014

Color.White is getting skipped when using drawString() java


Vote count:

0




When I was trying to draw white letters on a black background I noticed something weird.



public void paint(Graphics g) {
super.paint(g);
g.setColor(new Color(255,255,255));
g.drawString("Hello World",100,100);
}


Gave me this: "White" letters on a black background


Lines, however, were being drawn well.


"White" letters and a white line on a black background


When I took a different, but very close, color (254, 255, 255), I got this


White letters on a black background


Why is java.awt.Graphics blocking pure white (255,255,255) letters from being drawn (even when it is on a black background) ?


Tia, Charlie



asked 34 secs ago







Color.White is getting skipped when using drawString() java

Aucun commentaire:

Enregistrer un commentaire