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 Ugo,

> . . .
> Nah, that wasn't the hard stuff. Hard is to find why the attached code
> is not working...
>
> 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:
>
> (index->(r,g,b))
> r g b
> 1 1 1
> 1 0 0
> 0 1 0
> 0 0 1
> 0 0 1
> 1 0 1
> 1 1 0
> 0 0 0
>
> It's a white, r,g,b,c,m,y, black table. The problem is that the color
> control (or whatever!) ignores all colors but the initial white (1,1,1)
> and red (1,0,0).
>
> Note: colors must be between 0.0 and 1.0 (as specified in the
> documentation).
>
> 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

Cheers,
Bill


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