diff options
author | Scott Wichser <blast007@users.sourceforge.net> | 2019-01-26 02:09:16 +0000 |
---|---|---|
committer | Scott Wichser <blast007@users.sourceforge.net> | 2019-01-26 02:09:16 +0000 |
commit | 5a0215deac647f52da3e24dc47057af3b132654e (patch) | |
tree | 6f8b25d28688f885de1b0a788e77358fe1dc67d5 | |
parent | 89f9b855195cb2b2c6fdca3dd3c9a00f63afda94 (diff) | |
download | supybot_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.py | 2 |
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] |