Given the H,S,B (equivalent to H,S,V) values for the HSB color mode,
        convert them into the R,G,B values for the RGB color mode and return a
        color tuple. This conversion is necessary because Cairo understands
        only RGB(A).

def colorHSB(h, s, b):
        """
        Given the H,S,B (equivalent to H,S,V) values for the HSB color mode,
        convert them into the R,G,B values for the RGB color mode and return a
        color tuple. This conversion is necessary because Cairo understands
        only RGB(A).
        """
        H, S, B = float(h), float(s/100), float(b/100)
        if S == 0.0:
            return (B, B, B) # achromatic (grey)
        h = H / 60
        i = math.floor(h)
        f = h - i
        v = B
        p = v * (1 - S)
        q = v * (1 - S * f)
        t = v * (1 - S * (1 - f))
        if i == 0:
            return (v, t, b)
        elif i == 1:
            return (q, v, p)
        elif i == 2:
            return (p, v, t)
        elif i == 3:
            return (p, q, v)
        elif i == 4:
            return (t, p, v)
        else: # i == 5 (or i == 6 for the case of H == 360)
            return (v, p, q)