@@ -110,14 +110,14 @@ def calculate_spread(spread_quads, col):
110110 # TODO: Make more readable
111111 while 0 in taken_col :
112112 best_col = int (strength_spread .index (max (strength_spread )) / 2 )
113- if max (strength_spread ) is 0 :
113+ if max (strength_spread ) == 0 :
114114 best_col = taken_col .index (0 )
115- if taken_col [best_col ] is 0 :
115+ if taken_col [best_col ] == 0 :
116116 best_quad = spread_quads [best_col ].index (max (spread_quads [best_col ]))
117- if max (spread_quads [best_col ]) is 0 :
117+ if max (spread_quads [best_col ]) == 0 :
118118 sys .stderr .write (str (spread_quads ))
119119 best_quad = taken_quads .index (0 )
120- if taken_quads [best_quad ] is 0 :
120+ if taken_quads [best_quad ] == 0 :
121121 taken_quads [best_quad ] = 1
122122 taken_col [best_col ] = 1
123123 col [best_col ] = list (col [best_col ])
@@ -164,7 +164,7 @@ def get_colors(self):
164164 ranked_colors = sorted (image .getcolors (image .size [0 ] * image .size [1 ]), key = itemgetter (0 ))
165165 for i in range (len (ranked_colors )):
166166 colors .append (ranked_colors [len (ranked_colors ) - 1 - i ])
167- if self .MAX_COLORS is 1 :
167+ if self .MAX_COLORS == 1 :
168168 return colors [0 ]
169169 else :
170170 return self .find_best_colors (colors )
0 commit comments