Hi,
The idea being presenting collections of statics data in in different colors as an image or bitmap, the smaller the value the bluer the color and the bigger the value the red-er the color. Thus help understanding the data. The data are collections of series of non negative numbers, values ranging from less than 1 to thousands maybe millions. And the data has nil in those series, which may looks like this: #( #(nil nil nil nil 5 3 33 6.2 33 nil 3 nil nil nil ..) #(33 36 22 8288 nil 332 nil nil 33 44 55 ...) ..... thousands to come, with same size..... ) I have been reading Colors and Patterns in Basic Library Guide but not quite understand it, mainly since I know very little about Graphic and GUI things (since I seldom to Graphic programming) and can't not remember all those concepts at once. I guess that there is not too complex way to do this? Thanks in advance! Best Regards, Jim G _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
Hi Jim, this is a very quick-and-dirty example, but I guess you can do
something decent of it. The only bad thing about it is that you must know in advance the maximum value ("size" in this case) and that if you distribute colors in a uniform way, and have literally millions of numbers, the same color will be mapped to more than one number: | size image | size:=100. image:=Image extent: (size@10) depth: 24 palette: (FixedPalette redShift: 16 redMask: 16rFF greenShift: 8 greenMask: 16rFF blueShift: 0 blueMask: 16rFF). 0 to: (size - 1) do: [:i | | index color | color:=ColorValue red: (i / size) green: 0.0 blue: (1-(i / size)). index:=image palette indexOfPaintNearest: color. 0 to: 9 do: [:j | image atPoint: (i@j) put: index]]. image inspect. HTH, Andrés Jim Guo escribió: > Hi, > > The idea being presenting collections of statics data in in different > colors as an image or bitmap, the smaller the value the bluer the > color and the bigger the value the red-er the color. Thus help > understanding the data. > > The data are collections of series of non negative numbers, values > ranging from less than 1 to thousands maybe millions. And the data has > nil in those series, which may looks like this: > #( > #(nil nil nil nil 5 3 33 6.2 33 nil 3 nil nil nil ..) > #(33 36 22 8288 nil 332 nil nil 33 44 55 ...) > ..... thousands to come, with same size..... > ) > > I have been reading Colors and Patterns in Basic Library Guide but not > quite understand it, mainly since I know very little about Graphic and > GUI things (since I seldom to Graphic programming) and can't not > remember all those concepts at once. I guess that there is not too > complex way to do this? > > Thanks in advance! > > Best Regards, > > Jim G > _______________________________________________ > vwnc mailing list > [hidden email] > http://lists.cs.uiuc.edu/mailman/listinfo/vwnc > vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
Free forum by Nabble | Edit this page |