Changeset 5176
- Timestamp:
- Apr 1, 2015 6:34:02 PM (6 years ago)
- Location:
- branches/1.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.3
-
branches/1.3/gui/scripts/visviewer.tcl
r5108 r5176 933 933 934 934 itcl::body Rappture::VisViewer::ColorsToColormap { colors } { 935 set cmap {} 935 936 switch -- $colors { 936 937 "grey-to-blue" { 937 return{938 set cmap { 938 939 0.0 0.200 0.200 0.200 939 940 0.14285714285714285 0.400 0.400 0.400 … … 947 948 } 948 949 "blue-to-grey" { 949 return{950 set cmap { 950 951 0.0 0.000 0.600 0.800 951 952 0.14285714285714285 0.400 0.900 1.000 … … 959 960 } 960 961 "white-to-blue" { 961 return{962 set cmap { 962 963 0.0 0.900 1.000 1.000 963 964 0.1111111111111111 0.800 0.983 1.000 … … 973 974 } 974 975 "brown-to-blue" { 975 return{976 set cmap { 976 977 0.0 0.200 0.100 0.000 977 978 0.09090909090909091 0.400 0.187 0.000 … … 989 990 } 990 991 "blue-to-brown" { 991 return{992 set cmap { 992 993 0.0 0.000 0.480 0.600 993 994 0.09090909090909091 0.000 0.667 0.800 … … 1005 1006 } 1006 1007 "blue-to-orange" { 1007 return{1008 set cmap { 1008 1009 0.0 0.000 0.167 1.000 1009 1010 0.09090909090909091 0.100 0.400 1.000 … … 1021 1022 } 1022 1023 "orange-to-blue" { 1023 return{1024 set cmap { 1024 1025 0.0 1.000 0.167 0.000 1025 1026 0.09090909090909091 1.000 0.400 0.100 … … 1084 1085 } 1085 1086 "spectral" { 1086 return{1087 set cmap { 1087 1088 0.0 0.150 0.300 1.000 1088 1089 0.1 0.250 0.630 1.000 … … 1099 1100 } 1100 1101 "green-to-magenta" { 1101 return{1102 set cmap { 1102 1103 0.0 0.000 0.316 0.000 1103 1104 0.06666666666666667 0.000 0.526 0.000 … … 1119 1120 } 1120 1121 "greyscale" { 1121 return{1122 set cmap { 1122 1123 0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.0 1123 1124 } … … 1130 1131 } 1131 1132 } 1132 set cmap {} 1133 if { [llength $clist] == 1 } { 1134 set rgb [Color2RGB $clist] 1135 append cmap "0.0 $rgb 1.0 $rgb" 1133 if {$cmap == ""} { 1134 if { [llength $clist] == 1 } { 1135 set rgb [Color2RGB $clist] 1136 append cmap "0.0 $rgb 1.0 $rgb" 1137 } else { 1138 for {set i 0} {$i < [llength $clist]} {incr i} { 1139 set x [expr {double($i)/([llength $clist]-1)}] 1140 set color [lindex $clist $i] 1141 append cmap "$x [Color2RGB $color] " 1142 } 1143 } 1136 1144 } else { 1137 for {set i 0} {$i < [llength $clist]} {incr i} { 1138 set x [expr {double($i)/([llength $clist]-1)}] 1139 set color [lindex $clist $i] 1140 append cmap "$x [Color2RGB $color] " 1141 } 1145 regsub -all "\[ \t\r\n\]+" [string trim $cmap] " " cmap 1142 1146 } 1143 1147 return $cmap
Note: See TracChangeset
for help on using the changeset viewer.