Merge pull request #477 from campagnola/fix-intcolor-value
Fix value stepping in intColor
This commit is contained in:
commit
c44afa492a
@ -342,7 +342,7 @@ def colorStr(c):
|
|||||||
return ('%02x'*4) % colorTuple(c)
|
return ('%02x'*4) % colorTuple(c)
|
||||||
|
|
||||||
|
|
||||||
def intColor(index, hues=9, values=1, maxValue=255, minValue=150, maxHue=360, minHue=0, sat=255, alpha=255, **kargs):
|
def intColor(index, hues=9, values=1, maxValue=255, minValue=150, maxHue=360, minHue=0, sat=255, alpha=255):
|
||||||
"""
|
"""
|
||||||
Creates a QColor from a single index. Useful for stepping through a predefined list of colors.
|
Creates a QColor from a single index. Useful for stepping through a predefined list of colors.
|
||||||
|
|
||||||
@ -354,7 +354,7 @@ def intColor(index, hues=9, values=1, maxValue=255, minValue=150, maxHue=360, mi
|
|||||||
values = int(values)
|
values = int(values)
|
||||||
ind = int(index) % (hues * values)
|
ind = int(index) % (hues * values)
|
||||||
indh = ind % hues
|
indh = ind % hues
|
||||||
indv = ind / hues
|
indv = ind // hues
|
||||||
if values > 1:
|
if values > 1:
|
||||||
v = minValue + indv * ((maxValue-minValue) / (values-1))
|
v = minValue + indv * ((maxValue-minValue) / (values-1))
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user