summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2006-10-06 16:33:22 (GMT)
committerArmin Rigo <arigo@tunes.org>2006-10-06 16:33:22 (GMT)
commit615842fba6d4fdf7518c78d3707fa52847640c15 (patch)
tree7d135185c6335b6f31d1f89d4862a7e12517c161
parent9d57e53e4e2e359aa188850872566768a8c58075 (diff)
downloadcpython-615842fba6d4fdf7518c78d3707fa52847640c15.zip
cpython-615842fba6d4fdf7518c78d3707fa52847640c15.tar.gz
cpython-615842fba6d4fdf7518c78d3707fa52847640c15.tar.bz2
A very minor bug fix: this code looks like it is designed to accept
any hue value and do the modulo itself, except it doesn't quite do it in all cases. At least, the "cannot get here" comment was wrong.
-rw-r--r--Lib/colorsys.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/colorsys.py b/Lib/colorsys.py
index 39b4b16..851417b 100644
--- a/Lib/colorsys.py
+++ b/Lib/colorsys.py
@@ -117,7 +117,8 @@ def hsv_to_rgb(h, s, v):
p = v*(1.0 - s)
q = v*(1.0 - s*f)
t = v*(1.0 - s*(1.0-f))
- if i%6 == 0: return v, t, p
+ i = i%6
+ if i == 0: return v, t, p
if i == 1: return q, v, p
if i == 2: return p, v, t
if i == 3: return p, q, v