Fix hex color values for background color

This commit is contained in:
Nathan Gray 2011-08-09 20:58:41 +00:00
parent ff89732b24
commit 9cd080e2ef

View File

@ -182,9 +182,16 @@
</xsl:when>
<xsl:when test="starts-with(.,'background-color:')">
<xsl:variable name="hex">
<xsl:call-template name="rbga-to-hex">
<xsl:with-param name="rgba-val" select="substring-after(.,':')"/>
</xsl:call-template>
<xsl:choose>
<xsl:when test="contains(., 'rgb(')">
<xsl:call-template name="rbga-to-hex">
<xsl:with-param name="rgba-val" select="substring-after(.,':')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring-after(.,'#')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<style:text-properties fo:background-color="#{$hex}"/>
</xsl:when>