mirror of
https://github.com/freedoom/freedoom.git
synced 2025-09-02 16:25:47 -04:00
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:
parent
02bd566362
commit
27b04d1b9a
1 changed files with 1 additions and 1 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue