def hueLerp ( h1, h2, amt ):
""" Generic linear interpolation """
if isinstance( h1, int ):
h1 = h1 / 360.0
if isinstance( h2, int ):
h2 = h2 / 360.0
hue = h1 + Colz.shortHueDist( h1, h2) * amt
if hue > 1.0:
hue, whole = math.modf(hue) # Keep decimal part
if hue < 0.0:
hue, whole = math.modf(hue) # Keep decimal part
hue = 1.0 + hue
return hue
评论列表
文章目录