colormap: Explicitly use integer division operator.

Division behaves differently in Python 2 and Python 3; in Python 3, an
integer is converted to a float when divided. To get consistent and
deterministic behavior regardless of the version of Python being used,
use the // integer division operator for this one calculation.
This commit is contained in:
Simon Howard 2014-10-28 04:58:25 +00:00
parent 02bd566362
commit 27b04d1b9a

View file

@ -146,7 +146,7 @@ def invert_colors(colors):
result = []
for color in colors:
average = (color[0] + color[1] + color[2]) / 3
average = (color[0] + color[1] + color[2]) // 3
inverse = 255 - average
result.append((inverse, inverse, inverse))