[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Swarm-Support] EZGraph line colours
From: |
gepr |
Subject: |
Re: [Swarm-Support] EZGraph line colours |
Date: |
Mon, 3 Feb 2003 10:13:33 -0800 |
Michael Carney writes:
> I need to set the colours of the lines on my EZGraph for a swarm model I'm
> writting. Swarm automatically assigns colours to the lines but I need them
> to
> correspond to my agents colours. I was wondering would any know how I can do
> this.
>
> I'm developing in Java and using swarm-2.1.1.
You might try accessing the underlying graph components directly,
instead of going through EZGraph.
Then define something like:
static const char * colors[NUMCOLORS] =
{
"blue", "orange", "yellow", "green",
"red", "purple", "violet", "cyan",
"grey50", "darkgreen", "goldenrod", "seagreen",
"navy", "turquoise",
"khaki", "gold", "brown", "salmon",
"pink", "magenta", "maroon", "thistle"
};
And put as many values as you want in there, as long as they
comply with the colors Tcl/Tk understands.
When you define your graph element (the thing that actually draws
data to the graph), you can set the color directly using:
[ge setColor: colors[colorNdx % NUMCOLORS]];
--
glen e. p. ropella =><= Hail Eris!
H: 831.335.4950 http://www.ropella.net/~gepr
M: 831.247.7901 http://www.tempusdictum.com