aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Coffman <gears@apache.org>2000-07-12 22:49:47 +0000
committerSteve Coffman <gears@apache.org>2000-07-12 22:49:47 +0000
commitec1822b2c58cc7f9ae225ecb9bbdb8177e51d262 (patch)
treeb56470896503e57098f258800b37ef896b1ffe09
parent39fbd8e3d44725270627dad6c9cdba5a55d0633d (diff)
downloadxmlgraphics-fop-ec1822b2c58cc7f9ae225ecb9bbdb8177e51d262.tar.gz
xmlgraphics-fop-ec1822b2c58cc7f9ae225ecb9bbdb8177e51d262.zip
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
-rw-r--r--src/org/apache/fop/pdf/PDFColor.java9
1 files 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()
{