Exemplo n.º 1
0
 def get_color():
     iconcolor = None
     background = node.color
     if background is not None:
         c1 = Color("Black")
         c2 = Color("White")
         if Color.distance(background, c1)> Color.distance(background, c2):
             iconcolor = c1
         else:
             iconcolor = c2
     return iconcolor, background
Exemplo n.º 2
0
 def matching_color(col1, col2):
     result = False
     if col1 is None and col2 is None:
         result = True
     elif col1 is not None and col1.argb is not None and col2 is not None and col2.argb is not None:
         if fuzzy:
             distance = Color.distance(col1, col2)
             result = distance < fuzzydistance
         else:
             result = col1 == col2
     return result