improved color editor

This commit is contained in:
bancika
2011-01-14 16:23:00 +00:00
parent 4420a97993
commit c8de2aa271
2 changed files with 11 additions and 1 deletions
@@ -37,4 +37,14 @@ public class ColorEditor extends JLabel {
}
});
}
@Override
public void setBackground(Color bg) {
if (bg.getRed() < 127 || bg.getBlue() < 127 || bg.getGreen() < 127) {
setForeground(Color.white);
} else {
setForeground(Color.black);
}
super.setBackground(bg);
}
}