Tweaked random color algorithm
This commit is contained in:
parent
fef007f98d
commit
f63de4f5bb
1 changed files with 1 additions and 10 deletions
11
c4ctrl.py
11
c4ctrl.py
|
@ -608,7 +608,7 @@ class ColorScheme:
|
||||||
from random import randint, sample
|
from random import randint, sample
|
||||||
chls = [15]
|
chls = [15]
|
||||||
chls.append(randint(0,15))
|
chls.append(randint(0,15))
|
||||||
chls.append(randint(0,7) - chls[1])
|
chls.append(randint(0,15) - chls[1])
|
||||||
if chls[2] < 0: chls[2] = 0
|
if chls[2] < 0: chls[2] = 0
|
||||||
|
|
||||||
color = ""
|
color = ""
|
||||||
|
@ -616,15 +616,6 @@ class ColorScheme:
|
||||||
color += hex(ch)[2:]*2
|
color += hex(ch)[2:]*2
|
||||||
return color
|
return color
|
||||||
|
|
||||||
#def _random_color(self):
|
|
||||||
# """Returns a random 6 char hex color."""
|
|
||||||
# from random import randint
|
|
||||||
# color = ""
|
|
||||||
# for i in range(6):
|
|
||||||
# # Dont return smaller values than 11
|
|
||||||
# color = color + hex(randint(1, 15))[2:]
|
|
||||||
# return color
|
|
||||||
|
|
||||||
def color_for(self, topic):
|
def color_for(self, topic):
|
||||||
"""Returns the color (hex) this ColorScheme provides for the given topic."""
|
"""Returns the color (hex) this ColorScheme provides for the given topic."""
|
||||||
if self.mapping:
|
if self.mapping:
|
||||||
|
|
Loading…
Reference in a new issue