Ignore:
Timestamp:
2015-12-30T21:26:57+01:00 (8 years ago)
Author:
Don-vip
Message:

fix #12259 - adjust colors contrast in relation editor and history dialog

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/util/GuiHelper.java

    r9070 r9223  
    55
    66import java.awt.BasicStroke;
     7import java.awt.Color;
    78import java.awt.Component;
    89import java.awt.Container;
     
    4344import org.openstreetmap.josm.gui.widgets.HtmlPanel;
    4445import org.openstreetmap.josm.tools.CheckParameterUtil;
     46import org.openstreetmap.josm.tools.ColorHelper;
    4547import org.openstreetmap.josm.tools.GBC;
    4648import org.openstreetmap.josm.tools.ImageOverlay;
     
    367369        }
    368370    }
     371
     372    /**
     373     * Sets the background color for this component, and adjust the foreground color so the text remains readable.
     374     * @param c component
     375     * @param background background color
     376     * @since 9223
     377     */
     378    public static void setBackgroundReadable(JComponent c, Color background) {
     379        c.setBackground(background);
     380        c.setForeground(ColorHelper.getForegroundColor(background));
     381    }
    369382}
Note: See TracChangeset for help on using the changeset viewer.