groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Groff] [Tbl] Is color supported in TBL?


From: Ted Harding
Subject: RE: [Groff] [Tbl] Is color supported in TBL?
Date: Tue, 27 Nov 2001 00:41:29 -0000 (GMT)

On 26-Nov-01 George, Russell A wrote:
> Forgive the newbie question. Our reporting system is built entirely on
> tbl.
> One of our customers has requested color in our reports.
> 
> Thanks,
> 
> Russell.

Provided you use the PS output, you can arrange colour (in any
version of groff) by using the \X'ps: exec ... ' coomand.

Simple examples are:

.ds RED "\X'ps: exec 1 0 0 setrgbcolor'
.ds GREEN "\X'ps: exec 0 1 0 setrgbcolor'
.ds BLUE "\X'ps: exec 0 0 1 setrgbcolor'
.ds YELLOW "\X'ps: exec 1 1 0 setrgbcolor'
.ds MAGENTA "\X'ps: exec 1 0 1 setrgbcolor'
.ds CYAN "\X'ps: exec 0 1 1 setrgbcolor'
.ds BLACK "\X'ps: exec 0 0 0 setrgbcolor'
.ds WHITE "\X'ps: exec 1 1 1 setrgbcolor'
.br
This is normal text (in default black).
\*[BLUE]But this is Blue.
\*[GREEN]And this is Green.\*[BLACK]
and now we're back to black.

If you also need to have blocks of colour, it gets trickier.
For example, the following prints white inside a blue rectangle:

.br
.nr rectw \w' This is white text and we need its width 'u
\*[BLUE]\Z'\v'-0.25m'\
\D'P 0 -1m \n[rectw]u 0 0 2m -\n[rectw]u 0 0 1m''\
\*[WHITE] This is white text and we need its width \*[BLACK]

Now you've got the idea, you can play with your own variations.

Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Fax-to-email: +44 (0)870 167 1972
Date: 27-Nov-01                                       Time: 00:41:29
------------------------------ XFMail ------------------------------

reply via email to

[Prev in Thread] Current Thread [Next in Thread]