aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/render/PrintRenderer.java
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2006-05-03 07:21:02 +0000
committerJeremias Maerki <jeremias@apache.org>2006-05-03 07:21:02 +0000
commit6e9e6775bd5c5d16550ba64b7666eda6ed382d44 (patch)
treeb0ce141fdbd4d4499ea1ed4994fa9c5bb4b46bd2 /src/java/org/apache/fop/render/PrintRenderer.java
parent3fd99265691afe51eeccd10ecf704148eaaca669 (diff)
downloadxmlgraphics-fop-6e9e6775bd5c5d16550ba64b7666eda6ed382d44.tar.gz
xmlgraphics-fop-6e9e6775bd5c5d16550ba64b7666eda6ed382d44.zip
Bugzilla #38946:
First step for improved color handling. FOP's own ColorType was replaced with java.awt.Color throughout the codebase. Submitted by: Max Berger <max.at.berger.name> git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@399185 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/render/PrintRenderer.java')
-rw-r--r--src/java/org/apache/fop/render/PrintRenderer.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/java/org/apache/fop/render/PrintRenderer.java b/src/java/org/apache/fop/render/PrintRenderer.java
index dab571d47..d782a7eed 100644
--- a/src/java/org/apache/fop/render/PrintRenderer.java
+++ b/src/java/org/apache/fop/render/PrintRenderer.java
@@ -80,8 +80,10 @@ public abstract class PrintRenderer extends AbstractRenderer {
* @return the modified color
*/
public static Color lightenColor(Color col, float factor) {
- float[] cols = new float[3];
- cols = col.getColorComponents(cols);
+ // TODO: This function converts the color into the sRGB namespace.
+ // This should be avoided if possible.
+ float[] cols = new float[4];
+ cols = col.getRGBComponents(cols);
if (factor > 0) {
cols[0] += (1.0 - cols[0]) * factor;
cols[1] += (1.0 - cols[1]) * factor;
@@ -91,7 +93,7 @@ public abstract class PrintRenderer extends AbstractRenderer {
cols[1] -= cols[1] * -factor;
cols[2] -= cols[2] * -factor;
}
- return new Color(cols[0], cols[1], cols[2]);
+ return new Color(cols[0], cols[1], cols[2], cols[3]);
}
}