summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorMarkus Keller2013-02-14 08:23:21 (EST)
committer Paul Webster2013-04-01 10:55:59 (EDT)
commitb92bc48aa3f7e68b3fa524a6fc0bec591e9f4f06 (patch)
treee2342f77967d4c42ab41942058fe88876f2c56b5
parent511f057139919c0a206c7644b43722bd35d50a7e (diff)
downloadeclipse.platform.ui-b92bc48aa3f7e68b3fa524a6fc0bec591e9f4f06.zip
eclipse.platform.ui-b92bc48aa3f7e68b3fa524a6fc0bec591e9f4f06.tar.gz
eclipse.platform.ui-b92bc48aa3f7e68b3fa524a6fc0bec591e9f4f06.tar.bz2
Bug 163335: [Themes] JFaceColors.getHyperlinkText() returns incorrect color in high contrast mode
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/RGBBrightnessColorFactory.java26
1 files changed, 9 insertions, 17 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/RGBBrightnessColorFactory.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/RGBBrightnessColorFactory.java
index 0de896c..23821e9 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/RGBBrightnessColorFactory.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/RGBBrightnessColorFactory.java
@@ -31,23 +31,15 @@ public class RGBBrightnessColorFactory implements IColorFactory, IExecutableExte
* @see org.eclipse.ui.themes.IColorFactory#createColor()
*/
public RGB createColor() {
- RGB finalRGB = new RGB(0, 0, 0);
- try {
- if (color != null && scaleFactor != null) {
- RGB rgb = ColorUtil.getColorValue(color);
- float scale = Float.parseFloat(scaleFactor);
- float[] hsb = rgb.getHSB();
- hsb[2] *= scale;
- if (hsb[2] < 0)
- hsb[2] = 0;
- if (hsb[2] > 255)
- hsb[2] = 255;
- finalRGB = new RGB(hsb[0], hsb[1], hsb[2]);
- }
- } catch (NumberFormatException ex) {
- }
-
- return finalRGB;
+ RGB rgb = ColorUtil.getColorValue(color);
+ float scale = Float.parseFloat(scaleFactor);
+ float[] hsb = rgb.getHSB();
+ float b = hsb[2] * scale;
+ if (b < 0)
+ b = 0;
+ if (b > 1)
+ b = 1;
+ return new RGB(hsb[0], hsb[1], b);
}
/**