Michael Schindler <michael.schindler <at> physik.uni-augsburg.de> writes:
>
> pal = color.functionpalette(functions={"r":red, "g":green, "b":blue},
type="rgb")
> c.fill(path.rect(0, 0, 1, 1), [pal.getcolor(0.3)])
> c.fill(path.rect(1, 0, 1, 1), [pal.getcolor(0.6)])
> c.fill(path.rect(2, 0, 1, 1), [pal.getcolor(0.0)])
> c.fill(path.rect(3, 0, 1, 1), [pal.getcolor(1.0)])
This is a very nice example. Thank you. I think this is applicable to my
needs certainly. However, I'd like to use something slightly different:
instead of a single-argument getcolor function, I'd like a delayed
two-argument function, where the second argument is the number of
rendered points. I figure under the hood this must be used somewhere,
because the getcolor arguments for a color gradient are not actually
calculated until all of the calls are made. (How does this work? Clearly
getcolor will take different arguments if I specify a different number of
points with a gradient.)
So what I really want for four points is:
pal.getcolor(1, 4)
pal.getcolor(2, 4)
pal.getcolor(3, 4)
pal.getcolor(4, 4)
where the second argument is the number of points rendered (and shouldn't
be calculated until all the points are specified, hence the delayed nature
of the function). I can then write the functions appropriately. Any way to
persuade PyX to do that?
JDO
-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user