GetColor TCL UTILITIES USER MANUAL GetColor
SYNOPSIS
Assign color to a value
PACKAGE
TCLGPH
NAME
GetColor
USAGE
GetColor  V cMap
INPUT DEFINITIONS
V - Value
cMap - Color map incormation array generated by the PLTcolorMap routine.
RETURN DEFINITION
NONE
DESCRIPTION
GetColor maps a value to a color in the current color table. The mapping is done using the color map information array generated in a call to the procedure PLTcolorMap. Values which map to color positions less than 0 are returned as zero and values which map to color positions greater than 254 of 255 (depending on whether the top color, usually white, is included or excluded from the mapping) are returned as 254 or 255 respectively.
ERRORS
None Generated
C BACKING
No
EXAMPLE(S)
EXAMPLE 1:Using GetColor
# INITIALIZE the default gui settings

GUIprefsRead

# SET a window size

set GphInfo(xsScrL) 600
set GphInfo(ysScrL) 500
set GphInfo(xScrL) 600
set GphInfo(yScrL) 500

# START graphics

GraphicsOn TK RainBow SWAP

# SET up a graphics window  on the canvas.

GenWindow  0 0.0 0.0 0.0 1.0 1.0 0.0 -1.0 -1.0 0.0 1.0 1.0 0.0 

PLTcolorMap 0.0 2000.0 LINEAR NO cMap

set X -0.9
while { $X < 0.9 } {
   set V [expr int([TUdataRnd1 R 1 P 2000.0])]
   set C [GetColor $V cMap]
   PlotColor HOLD $C $C
   set nX [expr $X + .025]
   Box 0 $X -0.25 0.0 $nX 0.25 0.0
   set X $nX
}
      
March 2, 2007