|
From: Ethan M. <merritt@u.washington.edu> - 2004-11-25 20:24:35
|
On Thursday 25 November 2004 12:30 am, Petr Mikulik wrote:
> > I have just uploaded to SourceForge a new patchset #1072284 that allows
> > all plot elements, 2D or 3D, to use PM3D palette coloring options.
>
> Isn't there white and black missing in the color wheel?
The color wheel in the demo is a standard HSV colorwheel with
Saturation and Value both set to 1. That is, it maps the fractional
gray value onto a fully saturated Hue. White would correspond to
S=0; Black would correspond to V=0. These are not in the wheel,
but you don't need a color wheel to specify black or white
(actually foreground/background) since these are already available
as lt -1 and lt -2.
> 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".
The colorwheel demo shows one possible use of this feature for
2D plots. I agree that the use of a specific color wheel is not compatible
with 3D plots that require a different palette function.
> If you look to show.c:show_palette_fit2rgbformulae(), there is a method to
> calculate distance between given (rgb) color and any other color.
> MyLightRed = getcolor(0.9,0.01,0.01)
>
That's a good idea. It would still be a problem that if you change
the palette, any existing *constant* color assignments would become
invalid. In order to make such definitions independent of the
current palette, they would have to themselves be functions that
are evaluated at plot time. So I think it would have to be:
MyLightRed() = sprintf("%3.1f",getcolor(0.9,0.01,0.01))
plot sin(x) lt palette frac MyLightRed()
(yes, I know it is not currently possible to define a function with
no arguments)
or maybe
MyLightRed = 'lt palette frac sprintf("%3.1f",getcolor(.9,.1,.1))'
plot sin(x) @MyLightRed
We could leave this choice up to the user, however. Both become
possible if we introduce a user-callable function getcolor(r,g,b).
> > PM3D palette
>
> I would rather call it "palette of smooth continuous colors" or like that,
OK.
The required configuration option is ./configure --enable-pm3d,
and the documentation uses this term in many places. I agree that it
would be better to distinguish between the palette to choose specific
colors and the use of a palette to map colors onto 3D surfaces (=pm3d).
|