0030969: Coding Rules - refactor Quantity_Color.cxx color table definition
[occt.git] / tests / bugs / vis / bug27573
CommitLineData
d5514578 1puts "============"
61f73653 2puts "0027573: AIS_ColorScale::FindColor does not take into account custom colors."
d5514578 3puts "============"
4puts ""
5
6vclose all
61f73653 7vinit View1
d5514578 8vclear
9vaxo
10
11vcolorscale cs -demo
12vcolorscale cs -range 0 20 5
13
14# Set user-defined colors and labels for color scale
aaf8d6a9 15vcolorscale cs -colors white red green BLUE gray
61f73653 16vdump ${imagedir}/${casename}_pos.png
d5514578 17
61f73653 18if {[vcolorscale cs -findcolor 0] != "WHITE"} { puts "ERROR: wrong 1st segment сolor" }
19if {[vcolorscale cs -findcolor 4] != "RED"} { puts "ERROR: wrong color on border between 1st and 2nd segments" }
20if {[vcolorscale cs -findcolor 5] != "RED"} { puts "ERROR: wrong 2nd segment color" }
21if {[vcolorscale cs -findcolor 9] != "GREEN"} { puts "ERROR: wrong 3rd segment color" }
22if {[vcolorscale cs -findcolor 20] != "GRAY"} { puts "ERROR: wrong last segment color at border" }
d5514578 23
24# Check negative value limits
25vcolorscale cs -range -5 5 5
61f73653 26vdump ${imagedir}/${casename}_neg.png
d5514578 27
61f73653 28if {[vcolorscale cs -findcolor -5] != "WHITE"} { puts "ERROR: wrong first segment color" }
29if {[vcolorscale cs -findcolor 0] != "GREEN"} { puts "ERROR: wrong middle segment color" }
30if {[vcolorscale cs -findcolor 5] != "GRAY"} { puts "ERROR: wrong last segment color" }