@@ -6325,21 +6325,19 @@ def alternate(func, set_value, unset_value, width, height):
63256325 def test_from_threshold (self ):
63266326 """Does mask.from_threshold() work correctly?"""
63276327
6328- a = [16 , 24 , 32 ]
6328+ bpp = [16 , 24 , 32 ]
63296329
6330- for i in a :
6330+ for i in bpp :
63316331 surf = pygame .surface .Surface ((70 , 70 ), 0 , i )
63326332 surf .fill ((100 , 50 , 200 ), (20 , 20 , 20 , 20 ))
63336333 mask = pygame .mask .from_threshold (
63346334 surf , (100 , 50 , 200 , 255 ), (10 , 10 , 10 , 255 )
63356335 )
63366336
6337- rects = mask .get_bounding_rects ()
6338-
63396337 self .assertEqual (mask .count (), 400 )
63406338 self .assertEqual (mask .get_bounding_rects (), [pygame .Rect ((20 , 20 , 20 , 20 ))])
63416339
6342- for i in a :
6340+ for i in bpp :
63436341 surf = pygame .surface .Surface ((70 , 70 ), 0 , i )
63446342 surf2 = pygame .surface .Surface ((70 , 70 ), 0 , i )
63456343 surf .fill ((100 , 100 , 100 ))
@@ -6356,6 +6354,10 @@ def test_from_threshold(self):
63566354 self .assertEqual (mask .count (), 100 )
63576355 self .assertEqual (mask .get_bounding_rects (), [pygame .Rect ((40 , 40 , 10 , 10 ))])
63586356
6357+ for color in [(20 , 20 , 20 ), 10 , "green" , pygame .Color ("blue" )]:
6358+ surf = pygame .surface .Surface ((10 , 10 ))
6359+ pygame .mask .from_threshold (surf , color , color )
6360+
63596361 def test_zero_size_from_surface (self ):
63606362 """Ensures from_surface can create masks from zero sized surfaces."""
63616363 for size in ((100 , 0 ), (0 , 100 ), (0 , 0 )):
0 commit comments