Just in case this is useful for anybody: here is an implementation of the HSV to RGB colorspace conversion in Python:
from __future__ import division
def hsv2rgb(h, s, v):
hi = int(h//60 % 6)
f = h/60 - h//60
p = v * (1-s)
q = v * (1-f*s)
t = v * (1-(1-f)*s)
return [ (v,t,p), (q,v,p), (p,v,t), (p,q,v), (t,p,v), (v,p,q) ][hi]
Update. In the meantime I learned that the Python standard library has a built-in version of this function in the colorsys module.