[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Groff] colors (was: snprintf)
From: |
Werner LEMBERG |
Subject: |
[Groff] colors (was: snprintf) |
Date: |
Tue, 21 Aug 2001 09:45:48 +0200 (CEST) |
> here is a tiny patch to fix the problem identified above.
Applied, thanks.
> I've been thinking about html tables and tbl, reading the
> preproc/tbl code but as of yet written nothing. It would be nice to
> get tbl to emit tags as per troff, and maybe the www macro set could
> utilise these tags as well. Have you any particular view on how
> this should be done (particular in respect of coloured cells?).
No. It might be a good idea to have colours in mind while
implementing this. Maybe the following base commands are sufficient
(I got this from LaTeX's color implementation):
defcolor <color> <scheme> <parameter1> <parameter2> ...
Define colour with name <color>. <scheme> can be `gray', `cmyk',
`rgb', `hsb'; <parameterX> should be either a real value between
0 and 1 or a hex value (probably starting with `#') between 0 and
255. Do we need a value between 0 and 65535 also? This could be
started with, say, `##'. Or shall we stay with the RRGGBB and
RRRRGGGGBBBB notation of X?
color <color>
Activate colour with name <color>.
pagecolor <color>
Set background to colour with name <color>.
pushcolor
Push current colour onto a colour stack.
popcolor
Pop current colour from the colour stack.
The question is whether these commands should be implemented as
primitives or via the \X interface. Since groff doesn't have the
concept of groups it is probably not necessary to have the commands
`pushcolor' and `popcolor' at all.
Any ideas which requests in groff should be modified to handle colours
directly? Two things come to my mind:
. Emitting the current text and background colour at the beginning
of a page to make it available to macros.
. Saving and restoring colours before and after a three-part title
line.
Anything else?
Comments, please.
> BTW, your changes to make groff use config.h make for much neater
> compile sessions.
Have a look also at the `subdir' variable and the `subdir_Makefile'
target in `Makefile'. This can save a lot of time if you are working
at a single program only. In case you are using GNU make, calling it
with the parameter -r should increase speed additionally.
Werner