From ec1822b2c58cc7f9ae225ecb9bbdb8177e51d262 Mon Sep 17 00:00:00 2001 From: Steve Coffman Date: Wed, 12 Jul 2000 22:49:47 +0000 Subject: Fix Eric Schaeffer's bug with the int color conversions going to PDF -1.0 to 1.0. Clean and easy. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193494 13f79535-47bb-0310-9956-ffa450edef68 --- src/org/apache/fop/pdf/PDFColor.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/org/apache/fop/pdf/PDFColor.java b/src/org/apache/fop/pdf/PDFColor.java index d0e918fbc..bcf833851 100644 --- a/src/org/apache/fop/pdf/PDFColor.java +++ b/src/org/apache/fop/pdf/PDFColor.java @@ -93,7 +93,8 @@ public class PDFColor extends PDFPathPaint { // components from 0 to 255 public PDFColor(int theRed, int theGreen, int theBlue) { - this(((double) theRed) / 255d * 2d - 1d, ((double) theGreen) / 255d * 2d - 1d, ((double) theBlue) / 255d * 2d - 1d); + this(((double) theRed) / 255d, ((double) theGreen) / 255d, ((double) theBlue) / 255d ); + } public PDFColor(double theCyan, double theMagenta, double theYellow, double theBlack) { @@ -146,15 +147,15 @@ public class PDFColor extends PDFPathPaint { } public int red255() { - return (int) ((this.red + 1d) / 2d * 255d); + return (int) (this.red * 255d); } public int green255() { - return (int) ((this.green + 1d) / 2d * 255d); + return (int) (this.green * 255d); } public int blue255() { - return (int) ((this.blue + 1d) / 2d * 255d); + return (int) (this.blue * 255d); } public double cyan() { -- cgit v1.2.3