aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Wichser <blast007@users.sourceforge.net>2019-01-26 02:09:16 +0000
committerScott Wichser <blast007@users.sourceforge.net>2019-01-26 02:09:16 +0000
commit5a0215deac647f52da3e24dc47057af3b132654e (patch)
tree6f8b25d28688f885de1b0a788e77358fe1dc67d5
parent89f9b855195cb2b2c6fdca3dd3c9a00f63afda94 (diff)
downloadsupybot_github-5a0215deac647f52da3e24dc47057af3b132654e.tar.gz
supybot_github-5a0215deac647f52da3e24dc47057af3b132654e.tar.bz2
supybot_github-5a0215deac647f52da3e24dc47057af3b132654e.zip
Ensure we're working with all integers in the _colourDistance function to avoid an unsupported operand error.
-rw-r--r--local/utility.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/local/utility.py b/local/utility.py
index 40addd4..391051d 100644
--- a/local/utility.py
+++ b/local/utility.py
@@ -267,7 +267,7 @@ def _hex_to_rgb(value):
def _colourDistance(a, b):
# Source: http://www.compuphase.com/cmetric.htm
- rmean = (a[0] + b[0]) / 2
+ rmean = math.floor((a[0] + b[0]) / 2)
red = a[0] - b[0]
green = a[1] - b[1]
blue = a[2] - b[2]

© 2014-2024 Faster IT GmbH | imprint | privacy policy