From c906c2eb66c2b0fdda6933cd70099df732a72db1 Mon Sep 17 00:00:00 2001 From: Sfan5 Date: Sat, 4 Jan 2014 16:06:51 +0100 Subject: [PATCH] How about actual rainbow colors? --- rainbow.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/rainbow.py b/rainbow.py index d479f74..4fa3310 100755 --- a/rainbow.py +++ b/rainbow.py @@ -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):