]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Fix Eric Schaeffer's bug with the int color conversions going to PDF -1.0
authorSteve Coffman <gears@apache.org>
Wed, 12 Jul 2000 22:49:47 +0000 (22:49 +0000)
committerSteve Coffman <gears@apache.org>
Wed, 12 Jul 2000 22:49:47 +0000 (22:49 +0000)
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

index d0e918fbc3dbf5bca55ea740551d9b9941f43fa7..bcf83385190c2897b72e4cff2b739d19ec16f6ab 100644 (file)
@@ -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()
        {