5 ####################################################
6 # Data Exchange - Support alpha-channel of color
7 ####################################################
11 # Create document with View
12 NewDocument D_First BinXCAF
17 XSetColor D_First b_1 1 0 0 s
18 XSetColor D_First b_2 1 1 0 0.3 s
19 XSetColor D_First b_11 1 1 1 0.2 c
20 XSetColor D_First b_10 0 1 1 c
21 XAddColor D_First 0.5 0.5 1 0.1
26 vdump $::imagedir/${::casename}_first.png
27 if { [vreadpixel 300 200 rgb name] != "DARKKHAKI" } { puts "Error: wrong color in 3D Viewer" }
30 SaveAs D_First ${imagedir}/bug28521.xbf
33 XOpen ${imagedir}/bug28521.xbf D_Second
41 set res [XGetColor D_Second 0:1:2:1]
46 set res [XGetColor D_Second 0:1:2:2]
47 regexp {([A-Z0-9]+) \(([0-9.+eE]+)\)} $res full color alpha
48 if {$color != "YELLOW"} {
51 if {[expr abs(0.3 - $alpha)] > $prec} {
55 set res [XGetColor D_Second 0:1:2:3]
56 regexp {([A-Z0-9]+) \(([0-9.+eE]+)\)} $res full color alpha
57 if {$color != "WHITE"} {
60 if {[expr abs(0.2 - $alpha)] > $prec} {
64 set res [XGetColor D_Second 0:1:2:4]
65 if {$res != "CYAN1"} {
69 set res [XGetColor D_Second 0:1:2:5]
70 regexp {([A-Z0-9]+) \(([0-9.+eE]+)\)} $res full color alpha
71 if {$color != "LIGHTSLATEBLUE"} {
74 if {[expr abs(0.1 - $alpha)] > $prec} {
79 puts "Error: wrong color."
85 vdump $::imagedir/${::casename}.png
86 if { [vreadpixel 300 200 rgb name] != "DARKKHAKI" } { puts "Error: wrong color in 3D Viewer" }