@@ -211,6 +211,14 @@ ColorTypes.comp2(c::RGBA32) = alpha(c)
211211 @test sum (a) == Gray (n8sum (0.8 ,0.7 ))
212212 @test sum (a[1 : 1 ]) == a[1 ]
213213 @test abs ( varmult (* , a) - (a[1 ]- a[2 ])^ 2 / 2 ) <= 0.001
214+ ab = Gray[true , true ]
215+ @test sum (ab) === Gray (n8sum (true , true ))
216+ @test prod (ab) === Gray (true )
217+ ab = Gray[true ]
218+ @test sum (ab) === Gray (n8sum (true , false ))
219+ @test prod (ab) === Gray (true )
220+ @test sum (Gray{Bool}[]) === Gray (n8sum (false , false ))
221+ @test prod (Gray{Bool}[]) === one (Gray{Bool})
214222
215223 @test real (Gray{Float32}) <: Real
216224 @test zero (ColorTypes. Gray) == 0
@@ -427,10 +435,14 @@ ColorTypes.comp2(c::RGBA32) = alpha(c)
427435 a = RGB{N0f8}[RGB (1 ,0 ,0 ), RGB (1 ,0.8 ,0 )]
428436 @test sum (a) == RGB (2.0 ,0.8 ,0 )
429437 @test sum (typeof (a)()) == RGB (0.0 ,0.0 ,0 )
438+ ab = [RGB (true , false , true ), RGB (true , false , false )]
439+ @test sum (ab) === RGB (n8sum (true , true ), n8sum (false , false ), n8sum (true , false ))
440+ ab = [RGB (true , false , true )]
441+ @test sum (ab) === RGB (n8sum (true , false ), n8sum (false , false ), n8sum (true , false ))
442+
430443 @test isapprox (a, a)
431444 a = RGB {Float64} (1.0 , 1.0 , 0.9999999999999999 )
432445 b = RGB {Float64} (1.0 , 1.0 , 1.0 )
433-
434446 @test isapprox (a, b)
435447 a = RGB {Float64} (1.0 , 1.0 , 0.99 )
436448 @test ! (isapprox (a, b, rtol = 0.01 ))
0 commit comments