|
From: Ethan M. <merritt@u.washington.edu> - 2004-11-28 22:59:06
|
On Thursday 25 November 2004 12:30 am, Petr Mikulik wrote: > > However, it is not flexible for using "red", "white", etc colors in splots. > I would prefer an approach that would itself be able to extract a > color matching to e.g. "red". Done. Revised patchset on SourceForge. I have added a suboption keyword "rgbcolor" (shorthand "rgb") to the linetype specifier. It accepts a string parameter which is either a hexadecimal RGB triple in the form "#RRGGBB" or one of the color names in gnuplot's internal table. See "show palette colornames". plot "foo" with lines lt rgb "#DDFF00" plot "bar" with lines lt rgb "goldenrod" It is up to the individual drivers how to provide these colors, and of course it only works for terminal types that support RGB color. > If you look to show.c:show_palette_fit2rgbformulae(), there is a method to > calculate distance between given (rgb) color and any other color. I tried that first, but it turns out not to work very well. The problem is that it only knows about colors in the current palette, and most "pure" colors do not appear in the palette at all. So for example, the default palette has no greens. Requesting anything green or greenish by this mechanism returns black. It is of course possible to define a palette that contains a comprehensive sampling of colors, but then you are right back to the problem that the color selection method only works with certain specific palettes. Anyway, the direct RGB request method works much better. Have a look. |