Do you know where the class is stored in Flex 3 Plugin? It was halodefaults.as, apparently in Flex 2, but I can't find it in Flex 3?
I'll look into Math.random suggestion. Thank you! Don --- In flexcoders@yahoogroups.com, Sherif Abdou <[EMAIL PROTECTED]> wrote: > > why dont u just take a look at the class and see how they do it and u can always use Math.random() to give random colors. The way i seen it done in everybook is just Math.random()*0xFFFFFF > > ----- Original Message ---- > From: nasawebguy <[EMAIL PROTECTED]> > To: flexcoders@yahoogroups.com > Sent: Monday, February 4, 2008 4:24:36 PM > Subject: [flexcoders] generate unique colors for per-item fill > > How do I generate a list of unique colors dynamically in AS? similar > to how Flex does in default charts, except in a per-item fill scenario? > > CONTEXT > I want to color code an Hlist of categories to match the dot colors in > a per-item filled Plot Series. > > I have an arrayCollection dataProvider that is a list of categories > [categoryid, category] . (number of categories is unknown/unlimited) . > I'd like to generate a unique color number corresponding to each > category in the array and update that arrayCollection with the > generated color numbers.[categoryid ,category, color] > > I'd like to use this resulting [categoryid, category, color] > arrayCollection as a dataProvider to a horizontalList (dynamic legend > list) and a PlotChart per-item fill (Ifill) to color code the dots for > each category. User clicks on a color/cat in Hlist, filters the dots > for the selected category. Colors in the Hlist match the corresponding > colors in the plotchart. > > I know how to color code the horizontalList, build the fillFunction, > and do the filterFunction. .. > > but I don't know how to generate the unique colors (much like Flex > does for the default colors in charts) in a per-item fill scenario. > > I'm assuming I'd loop through the arrayCollection of categories and > update the color dynamically using some color generator? The colors > need to be as unique as possible. > > It would be cool if I could somehow use Flex's built-in default unique > colors for chart series in the per-item fill case? > > I could create a color column in the category table in the database, > and store colors there for each one, but seems to me that AS might be > a better approach. > > Thanks! > Don > > > > > > ____________________________________________________________________________________ > Be a better friend, newshound, and > know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ >