use of javax.swing.plaf.ColorUIResource in project omegat by omegat-org.
the class UIDesignManager method ensureTitlebarReadability.
private static void ensureTitlebarReadability() {
// to ensure DockViewTitleBar title readability
Color textColor = UIManager.getColor("InternalFrame.inactiveTitleForeground");
Color backColor = UIManager.getColor("Panel.background");
if (textColor != null && backColor != null) {
// One of these could be null
if (textColor.equals(backColor)) {
float[] hsb = Color.RGBtoHSB(textColor.getRed(), textColor.getGreen(), textColor.getBlue(), null);
// darkest 0.0f <--> 1.0f brightest
float brightness = hsb[2];
if (brightness >= 0.5f) {
// to darker
brightness -= 0.5f;
} else {
// to brighter
brightness += 0.5f;
}
int rgb = Color.HSBtoRGB(hsb[0], hsb[1], brightness);
ColorUIResource res = new ColorUIResource(rgb);
UIManager.put("InternalFrame.inactiveTitleForeground", res);
}
}
UIManager.put("DockingDesktop.notificationBlinkCount", 2);
UIManager.put("DockingDesktop.notificationColor", Styles.EditorColor.COLOR_NOTIFICATION_MAX.getColor());
}
Aggregations