Colormap Class : Demo applet
This is a little applet to test the Colormap class that I wrote.
It gives you a simple and easy way to assign a range of colors
and get the color by referencing a public array of the Colormap class.
This is all written in JAVA 1.0, but may be easily upgraded to
JAVA 1.1.
The source code is in
You can try out these things:
- click on the "Color Range:" input field and type in
128 or 256 or any number. This will change the number
of entries in the colormap table.
- click on the "Color String:" input field and type in
any combination of : 0 (black),
1(white),
r(red),
g(green),
b(blue),
y(yellow),
c(cyan),
m(magenta).
For example, type in 0ry1. It will show you a continuous
spectrum from Balck->
Red->
Yellow->
White.
- Some color strings that you can try out : 0r1, 0b1, 0y1,
rmbcg, gyrmbcg, 01, etc.