Color works fine for me in FOP.
I looked up default color names on the web and found these weird things,
from cornflowerblue to burlywood.
I just use a value of RGB(#,#,#) on the fill attribute in the svg tags.
Of course being a programmer I prefer to use the numbers to calculate
the colors rather than putting in goofy names.
I copied some SVG code for a pie chart from some web page and replaced
the color section (attempting to make the color of each slice
distinguishable from the next) with:
<xsl:when test="$i=1">rgb(255,127,127)</xsl:when>
<xsl:when test="$i=2">rgb(127,127,255)</xsl:when>
<xsl:when test="$i=3">rgb(255,255,127)</xsl:when>
<xsl:when test="$i=4">rgb(191,64,255)</xsl:when>
<xsl:when test="$i=5">rgb(127,255,127)</xsl:when>
<xsl:when test="$i=6">rgb(255,191,64)</xsl:when>
<xsl:when test="$i=7">rgb(223,95,191)</xsl:when>
<xsl:when test="$i=8">rgb(127,191,191)</xsl:when>
<xsl:when test="$i=9">rgb(255,223,32)</xsl:when>
<xsl:when test="$i=10">rgb(159,95,255)</xsl:when>
<xsl:when test="$i=11">rgb(191,255,127)</xsl:when>
<xsl:when test="$i=12">rgb(255,223,95)</xsl:when>
<xsl:when test="$i=13">rgb(239,111,223)</xsl:when>
<xsl:when test="$i=14">rgb(127,159,223)</xsl:when>
<xsl:when test="$i=15">rgb(255,239,79)</xsl:when>
<xsl:otherwise><xsl:value-of select="concat('rgb(',string(255
- (($i - 15) * 32)),',',string(255 - (($i - 15) * 32)),',',string(255 -
(($i - 15) * 32)),')')"/></xsl:otherwise>
-----Original Message-----
From: Jeremias Maerki [mailto:[email protected]]
Sent: Tuesday, June 15, 2010 2:02 PM
To: [email protected]; [email protected];
[email protected]
Subject: Thinking about color
Folks,
if you haven't seen it, yet, I've started to write down some notes on
handling color on the Wiki which applies to both Batik and FOP:
http://wiki.apache.org/xmlgraphics/ColorHandling
This is mostly triggered by my wanting to add support for named colors
in SVG and FO. I'm grateful for feedback from anyone who knows a few
things about colors. I'm especially hoping for Thomas to chime in since
her works for a color-phile company. ;-)
Discussion on general@ please.
Thanks,
Jeremias Maerki
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]