on_white = basic_color('107')
def init_cycle():
- colors_shuffle = [locals()[i.encode('utf8')] if not i.startswith(
- 'RGB_') else RGB(int(i[4:])) for i in c['CYCLE_COLOR']]
- cyc = itertools.cycle(colors_shuffle)
+ colors_shuffle = [globals()[i.encode('utf8')]
+ if not i.startswith('RGB_')
+ else RGB(int(i[4:]))
+ for i in c['CYCLE_COLOR']]
+ return itertools.cycle(colors_shuffle)
-init_cycle()
+cyc = init_cycle()
def order_rainbow(s):
"""
if c['theme'] == 'custom':
config = os.environ.get(
'HOME',
- os.environ.get(
- 'USERPROFILE',
+ os.environ.get('USERPROFILE',
'')) + os.sep + '.rainbow_config.json'
else:
config = 'rainbowstream/colorset/'+c['theme']+'.json'
if data:
for d in data:
c[d] = data[d]
+ # Re-init color cycle
+ cyc = init_cycle()
def color_func(func_name):
c[nc] = new_config[nc]
# Update db and reset colors
db.theme_update(g['stuff'])
- init_cycle()
+ cyc = init_cycle()
g['decorated_name'] = color_func(
c['DECORATED_NAME'])(
'[@' + g['original_name'] + ']: ')