View difference between Paste ID: mJKqmrWp and dnajmct6
SHOW: | | - or go back to the newest paste.
1
import math
2
gradient = ('#4bec13', '#12ff00', '#0fd200',)
3
def gradientmadness(text):
4
    leng = len(text)
5
    output = ''
6
    if leng < 3:
7
        for i in range(0, leng):
8
            output += '<c=#%s>' % gradient[i]
9
        for i in range(0, leng):
10
            output += text[i] + '</c>'
11
    else:
12
        output += '<c=#'
13
        output += '><c=#'.join(gradient)
14
        output += '>'
15
        size = int(math.ceil(leng / x.0))
16
        for i in range(1, x+1):
17
            output += text[(i-1)*size:i*size] + '</c>'
18
    return output
19
gradientmadness.command="glowygreenshit"
20
#usage regex replace ^(.*)$ -> functionname(\1)