/** * Returns the color to use for hyperlink-style components. This method * will return <code>Color.blue</code> unless it appears that the current * LookAndFeel uses light text on a dark background, in which case a * brighter alternative is returned. * * @return The color to use for hyperlinks. */ static Color getHyperlinkForeground() { // This property is defined by all standard LaFs, even Nimbus (!), // but you never know what crazy LaFs there are... Color fg = UIManager.getColor("Label.foreground"); if (fg==null) { fg = new JLabel().getForeground(); } return isLightForeground(fg) ? LIGHT_HYPERLINK_FG : Color.blue; }
/** * Returns a decent "parameter" color based on the current default * foreground color. * * @return The parameter color to use. */ private String createParamColor() { return Util.isLightForeground(getForeground()) ? Util.getHexString(Util.getHyperlinkForeground()): "#aa0077"; }