0030942: Draw Harness, ViewerTest - command vdefaults should abort script on unknown...
[occt.git] / tests / bugs / vis / bug25136
CommitLineData
71215351 1puts "============"
2puts "OCC25136"
3puts "Display customized colorscale."
4puts "============"
5puts ""
6
71215351 7vclear
4b3d6eb1 8vinit View1
71215351 9vaxo
10
11# create default color scale
4b3d6eb1 12vcolorscale cs1 -demo -xy 0 0
13foreach {y aColor} {20 RED 60 DARKORANGE1 100 GOLD 140 GREENYELLOW 180 CHARTREUSE2 220 GREEN 250 MEDIUMSPRINGGREEN 290 CYAN1 330 DODGERBLUE1 370 BLUE1} { if { [vreadpixel 15 $y rgb name] != "$aColor" } { puts "Error: wrong color at $y" } }
71215351 14
15# reduce color scale range and number of intervals
4b3d6eb1 16vcolorscale cs2 -range 0 20 5 -xy 60 0
17foreach {y aColor} {40 RED 120 YELLOW 200 GREEN 280 CYAN2 350 BLUE1} { if { [vreadpixel 75 $y rgb name] != "$aColor" } { puts "Error: wrong color at $y" } }
71215351 18
19# set user-defined colors and labels for color scale
4b3d6eb1 20vcolorscale cs3 -range 0 20 5 -colors white 0 0 1 green 1 0 0 1 1 1 -labels start 1 2 3 4 end -xy 120 0
21foreach {y aColor} {40 WHITE 120 RED 200 GREEN 280 BLUE1 350 WHITE} { if { [vreadpixel 135 $y rgb name] != "$aColor" } { puts "Error: wrong color at $y" } }
71215351 22
23# change colors of first and last intervals
4b3d6eb1 24vcolorscale cs4 -range 0 20 5 -colors white 0 0 1 green 1 0 0 1 1 1 -labels start 1 2 3 4 end -xy 200 0
25vcolorscale cs4 -color 1 0.42 0.35 0.8
26vcolorscale cs4 -color 5 pink
27vcolorscale cs4 -label 6 "last"
28vcolorscale cs4 -title "My color scale"
29foreach {y aColor} {60 PINK 120 RED 200 GREEN 280 BLUE1 350 SLATEBLUE} { if { [vreadpixel 215 $y rgb name] != "$aColor" } { puts "Error: wrong color at $y" } }
30vdump ${imagedir}/${casename}.png