[reportlab-users] how to register a color at runtime in order to use it with <font color="my_cd_color1">my text</font>
Thomas Kremmel
thomasspin at gmail.com
Thu Mar 25 09:04:18 EDT 2010
:D ok good question..
I changed it, thus no need to install a color at runtime.
I just stumbled upon this approach somewhere in the internet and used it.
Did not even tried just using the #rrggbb values.
Thaks for the hint!
2010/3/25 Roberto Alsina <ralsina at netmanagers.com.ar>
> On Thursday 25 March 2010 09:49:25 Thomas Kremmel wrote:
> > Hi,
> >
> > I'm using XPreformatted to print pre formated paragraphs, like this:
> >
> > invoice_subject_line_pre =
> > XPreformatted(smart_str(invoice_subject_line_rep),
> > invoice_subject_line_style)
> >
> > In this paragraphs it is possible to define the size, color, etc.. via
> some
> > xml markups.
> >
> > I'm using the following line to print some text in a different color.
> >
> > <font color="my_cd_color1">my textt</font>
> >
> > This does only work if reportlab does know the color "my_cd_color1". I'm
> > searching now a way how to register this color at runtime with reportlab.
> >
> > Till now I just added it to the colors.py at line 556, which works fine
> but
> > is probably a very hackish approach.
> >
> > reportlab\lib\colors.py insert at line 556
> > my_cd_color1 =HexColor("#b71234")
> >
> > I searched for a way to do this and did not find one, but want to get rid
> > of this approach.
>
> Since noone ever will see that markup, why not use #rrggbb ?
> _______________________________________________
> reportlab-users mailing list
> reportlab-users at lists2.reportlab.com
> http://two.pairlist.net/mailman/listinfo/reportlab-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20100325/910e6f29/attachment.html>
More information about the reportlab-users
mailing list