How about actual rainbow colors?

master
Sfan5 2014-01-04 16:06:51 +01:00
parent 2f7c24a0ca
commit c906c2eb66
1 changed files with 8 additions and 1 deletions

View File

@ -5,12 +5,19 @@ Copyright 2013, sfan5
"""
import random
rainbowcolors = ["4", "7", "8", "3", "12", "6", "13"]
#TODO: make this rainbow better (can't really make it that better because IRC colors suck)
def colorize(text):
out = ""
i = 0
for c in text:
if c in list(str(i) for i in range(10)):
c = u"\u200b" + c # 'ZERO WIDTH SPACE' cuz IRC clients are stupid
out += "\x03" + str(random.randint(2, 15)) + c
out += "\x03" + str(rainbowcolors[i]) + c
i += 1
if i >= len(rainbowcolors):
i = 0
return out
def rainbow(phenny, input):