0032208: Tests - refactor visualization tests to cover several graphic drivers
[occt.git] / tests / v3d / colorscale / bug25136
1 puts "============"
2 puts "OCC25136: Display customized colorscale."
3 puts "============"
4 puts ""
5
6 pload VISUALIZATION
7
8 vclear
9 vinit View1
10 vaxo
11
12 # create default color scale
13 vcolorscale cs1 -demo -xy 0 0
14 foreach {y aColor} {20 RED 60 DARKORANGE1 100 GOLD 140 GREENYELLOW 220 GREEN 250 MEDIUMSPRINGGREEN 290 CYAN 330 DODGERBLUE1 370 BLUE} { if { [vreadpixel 15 $y rgb name] != "$aColor" } { puts "Error: wrong color at $y" } }
15
16 # reduce color scale range and number of intervals
17 vcolorscale cs2 -range 0 20 5 -xy 60 0
18 foreach {y aColor} {40 RED 120 YELLOW 200 GREEN 280 CYAN2 350 BLUE} { if { [vreadpixel 75 $y rgb name] != "$aColor" } { puts "Error: wrong color at $y" } }
19
20 # set user-defined colors and labels for color scale
21 vcolorscale 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
22 foreach {y aColor} {40 WHITE 120 RED 200 GREEN 280 BLUE 350 WHITE} { if { [vreadpixel 135 $y rgb name] != "$aColor" } { puts "Error: wrong color at $y" } }
23
24 # change colors of first and last intervals
25 vcolorscale 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
26 vcolorscale cs4 -color 1 0.42 0.35 0.8
27 vcolorscale cs4 -color 5 pink
28 vcolorscale cs4 -label 6 "last"
29 vcolorscale cs4 -title "My color scale"
30 foreach {y aColor} {60 PINK 120 RED 200 GREEN 280 BLUE 350 LIGHTSTEELBLUE3} { if { [vreadpixel 215 $y rgb name] != "$aColor" } { puts "Error: wrong color at $y" } }
31 vdump ${imagedir}/${casename}.png