On Thursday 14 August 2008 13:24:37 Petr Mikulik wrote:
> > > There a patch "Tango color palette support" which adds the following "Tango
> > > colornames" into the list of color names in gnuplot:
> > >
> > > The patch is here:
> > > https://bugzilla.redhat.com/show_bug.cgi?id=458525
> > >
> > > Does it make sense to add more color names (see "show palette colornames")?
> >
> > Rather than adding specifically this small set (or any other small set)
> > of color names, I think it would make more sense to add a general mechanism.
> >
> > For example, all x11-based systems should have a file equivalent to
> > /usr/share/X11/rgb.txt, which contains entries of the form:
> > 250 235 215 antique white
> > 250 235 215 AntiqueWhite
> > 255 239 213 papaya whip
> > 255 239 213 PapayaWhip
> > 255 235 205 blanched almond
> > We could add a check for an environmental variable GNUPLOT_COLORNAMES,
> > default it to /usr/share/X11/rgb.txt, and write a corresponding parser routine.
> > Local customization is easy; just point GNUPLOT_COLORNAMES to a customized
> > file.
>
> I think this would be handy as well:
>
> set palette colornames add "white" "#FFFFFF"
> set palette colornames add "white" "#FFFFFF" "black" "#FFFFFF"
> set palette colornames from "/usr/share/X11/rgb.txt"
>
> It would overwrite and add new colours into the currently defined list of
> colours.
I've just noticed that internal lists are kept in two places, which is
just asking for conflicts.
src/bitmap.c
struct rgb web_color_rgbs[] =
{
{ 0xff, 0xff, 0xff }, /* background: white */
{ 0x00, 0x00, 0x00 }, /* borders: black */
... 99 names total
src/tables.c
/* fixed RGB color names for 'set palette defined' */
const struct gen_table pm3d_color_names_tbl[] =
{
/* black, white and gray/grey */
{ "white" , 255*(1<<16) + 255*(1<<8) + 255 },
{ "black" , 0*(1<<16) + 0*(1<<8) + 0 },
... 81 names total
The first step should somehow consolidate these into a single list,
which could then be made extensible.
--
Ethan A Merritt
|