|
From: Pierre <pie...@gm...> - 2007-02-04 15:41:30
|
On 2/3/07, Hans-Bernhard Br=F6ker <HBB...@t-...> wrote: > Pierre wrote: > > On 2/2/07, Hans-Bernhard Br=F6ker <HBB...@t-...> wrote: > >> To give an example, from an RGB palette defined like this: > >> > >> 0.0: blue > >> 0.5: white > >> 1.0: red > > > I'm not sure to understand the notion of palette in your example. > > It's a (principally) continuous mapping from a numeric value (the number > being displayed) to a colour. In the case above, it consists of two > linear paths, one from blue to white, the second from white to red. The > idea is to turn a data parameter into a colour, a.k.a. "false-colour > diagram". It's how altitude is often displayed on geographical maps > (green lowlands, brown hills, white peaks, blue ocean). Thanks for the explanation. I think the shaded triangle in #39 (http://bugs.libgd.org/?do=3Ddetails&task_id=3D39) should work. You can keep your mapping and pass the color value of each vertex. Within a triangle the colors will be inside your range (linear interpolation from c1 to c2 between two edges). I put a meaningless example here: http://blog.thepimp.net/misc/gdshading/ The color stop points are in the comments, it is something like a range -0.25..1.0 used "black blue red yellow". The results has no special value (besides being a nice shading effect ;), but it may help to see how gdShadedTriangle works and what should be done to match your needs. --Pierre |