Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- #Rainbow
- Rainbow = ('8B00FF','4B0082','00DDFF','00B200','D9D000','FF7F00','FF0000')
- def gradientRainbow(text):
- leng = len(text)
- output = ''
- if leng < 7:
- for i in range(0, leng):
- output += '<c=#%s>' % Rainbow[i]
- for i in range(0, leng):
- output += text[i] + '</c>'
- else:
- output += '<c=#'
- output += '><c=#'.join(Rainbow)
- output += '>'
- size = int(math.ceil(leng / 7.0))
- for i in range(1, 8):
- output += text[(i-1)*size:i*size] + '</c>'
- return output
- gradientRainbow.command="Rainbow"
- #usage regex replace ^(.*)$ -> functionname(\1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement