- Timestamp:
- Mar 13, 2015, 11:32:52 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/visviewer.tcl
r5069 r5126 949 949 950 950 itcl::body Rappture::VisViewer::ColorsToColormap { colors } { 951 set cmap {} 951 952 switch -- $colors { 952 953 "grey-to-blue" { 953 return{954 set cmap { 954 955 0.0 0.200 0.200 0.200 955 956 0.14285714285714285 0.400 0.400 0.400 … … 963 964 } 964 965 "blue-to-grey" { 965 return{966 set cmap { 966 967 0.0 0.000 0.600 0.800 967 968 0.14285714285714285 0.400 0.900 1.000 … … 975 976 } 976 977 "white-to-blue" { 977 return{978 set cmap { 978 979 0.0 0.900 1.000 1.000 979 980 0.1111111111111111 0.800 0.983 1.000 … … 989 990 } 990 991 "brown-to-blue" { 991 return{992 set cmap { 992 993 0.0 0.200 0.100 0.000 993 994 0.09090909090909091 0.400 0.187 0.000 … … 1005 1006 } 1006 1007 "blue-to-brown" { 1007 return{1008 set cmap { 1008 1009 0.0 0.000 0.480 0.600 1009 1010 0.09090909090909091 0.000 0.667 0.800 … … 1021 1022 } 1022 1023 "blue-to-orange" { 1023 return{1024 set cmap { 1024 1025 0.0 0.000 0.167 1.000 1025 1026 0.09090909090909091 0.100 0.400 1.000 … … 1037 1038 } 1038 1039 "orange-to-blue" { 1039 return{1040 set cmap { 1040 1041 0.0 1.000 0.167 0.000 1041 1042 0.09090909090909091 1.000 0.400 0.100 … … 1100 1101 } 1101 1102 "spectral" { 1102 return{1103 set cmap { 1103 1104 0.0 0.150 0.300 1.000 1104 1105 0.1 0.250 0.630 1.000 … … 1115 1116 } 1116 1117 "green-to-magenta" { 1117 return{1118 set cmap { 1118 1119 0.0 0.000 0.316 0.000 1119 1120 0.06666666666666667 0.000 0.526 0.000 … … 1135 1136 } 1136 1137 "greyscale" { 1137 return{1138 set cmap { 1138 1139 0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.0 1139 1140 } … … 1146 1147 } 1147 1148 } 1148 set cmap {} 1149 if { [llength $clist] == 1 } { 1150 set rgb [Color2RGB $clist] 1151 append cmap "0.0 $rgb 1.0 $rgb" 1149 if {$cmap == ""} { 1150 if { [llength $clist] == 1 } { 1151 set rgb [Color2RGB $clist] 1152 append cmap "0.0 $rgb 1.0 $rgb" 1153 } else { 1154 for {set i 0} {$i < [llength $clist]} {incr i} { 1155 set x [expr {double($i)/([llength $clist]-1)}] 1156 set color [lindex $clist $i] 1157 append cmap "$x [Color2RGB $color] " 1158 } 1159 } 1152 1160 } else { 1153 for {set i 0} {$i < [llength $clist]} {incr i} { 1154 set x [expr {double($i)/([llength $clist]-1)}] 1155 set color [lindex $clist $i] 1156 append cmap "$x [Color2RGB $color] " 1157 } 1158 } 1159 #regsub -all "\n" $cmap " " cmap 1161 regsub -all "\[ \t\r\n\]+" [string trim $cmap] " " cmap 1162 } 1160 1163 return $cmap 1161 1164 }
Note: See TracChangeset
for help on using the changeset viewer.