From 4f3ab56159ac8a61c19894abb83eca1ffad1b307 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Thu, 10 Feb 2011 12:43:14 +0000 Subject: [PATCH] Fix IF test for color_1.xml. The round-trip for the rgb() was not working with ColorUtil.isSameColor() as that checks deeper than just Color.equals(). git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_Color@1069366 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/util/ColorUtil.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/java/org/apache/fop/util/ColorUtil.java b/src/java/org/apache/fop/util/ColorUtil.java index 4354e7a8a..e1454a545 100644 --- a/src/java/org/apache/fop/util/ColorUtil.java +++ b/src/java/org/apache/fop/util/ColorUtil.java @@ -238,7 +238,11 @@ public final class ColorUtil { float red = parseComponent255(args[0], value); float green = parseComponent255(args[1], value); float blue = parseComponent255(args[2], value); - parsedColor = new Color(red, green, blue); + //Convert to ints to synchronize the behaviour with toRGBFunctionCall() + int r = (int)(red * 255 + 0.5); + int g = (int)(green * 255 + 0.5); + int b = (int)(blue * 255 + 0.5); + parsedColor = new Color(r, g, b); } catch (PropertyException pe) { //simply re-throw throw pe; -- 2.39.5