NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

Re: Color table from TextAdapter

Hi Bill,

Bill Hibbard wrote:
Hi Ugo,
...
. . .

I'm attaching a test program and a color table. The program creates some
 2D data, displays with rgb and then pops up a file chooser for the
user to load a color table. As said, the table comes free with this
email and looks like this:
...



Note: colors must be between 0.0 and 1.0 (as specified in the
documentation).

Huh! I hadn't read the documentation correctly...
It says *domain* and range must be between 0.0 and 1.0


Can anyone tell me what's wrong or what I'm doing wrong?


The problem is that a Function passed to
ColorControl.setFunction() must have a domain
Set with extents in (0.0, 1.0). The call to
visad.jmet.DumpType.dumpDataType() gives the
domain Set as:

  Linear1DSet (index) Range = 0.0 to 7.0 step 1.0

Which must be what the TextAdapter creates. It
would need to be:

  Linear1DSet (index) Range = 0.0 to 1.0 step 0.14285

Now I see...

I fixed this by introducing "index(0.0:1.0)" in the color table file, like this:

(index->(r,g,b))
r g b index(0.0:1.0)
1 1 1
1 0 0
0 1 0
0 0 1
0 0 1
1 0 1
1 1 0
0 0 0


Cheers,
Bill


Works great now!

Thanks,

Ugo


  • 2003 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: