This commit is contained in:
wowaname 2016-08-09 06:56:07 +00:00
parent 0b2d8156f6
commit 8635ba1a54
1 changed files with 7 additions and 3 deletions

View File

@ -111,13 +111,17 @@ def prism_cmd_cb(data, buffer, args):
regex = regex_words if 'w' in opts else regex_chars
inc = 'r' not in opts
bs = 'e' in opts
stretch = 's' in opts
colors = ncolors if 'x' not in opts else (xxcolors if bs or not inc else xcolors)
color_count = len(colors)
input = input[::-1] if 'b' in opts else input
output = u""
tokens = re.findall(regex, input)
if 's' in opts:
color_local = 0
colors = [colors[int(float(i)/len(tokens)*len(colors))]
for i in xrange(len(tokens))]
color_count = len(colors)
for token in tokens:
# prefix each token with a color code
c1 = unicode(colors[color_local % color_count]).rjust(2, "0")