]> granicus.if.org Git - python/commitdiff
A very minor bug fix: this code looks like it is designed to accept
authorArmin Rigo <arigo@tunes.org>
Fri, 6 Oct 2006 16:33:22 +0000 (16:33 +0000)
committerArmin Rigo <arigo@tunes.org>
Fri, 6 Oct 2006 16:33:22 +0000 (16:33 +0000)
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.

Lib/colorsys.py

index 39b4b165c3771477d058bd2f61790be431acf280..851417b5d5177b5d8ac894c82a9889b3b2bfaca1 100644 (file)
@@ -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