Skip to content

Commit

Permalink
A very minor bug fix: this code looks like it is designed to accept
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
arigo committed Oct 6, 2006
1 parent 9d57e53 commit 615842f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Lib/colorsys.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 615842f

Please sign in to comment.