Advertisement
Guest User

Absinthe Gradient Edit

a guest
Mar 2nd, 2015
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. gradient = ('55AB16', '50BF00', 'BCC200')
  2. def gradientmadness(text):
  3.     leng = len(text)
  4.     output = ''
  5.     if leng < 3:
  6.         for i in range(1, 3+1):
  7.             output += '<c=#%s>' % gradient[i]
  8.         for i in range(0, leng):
  9.             output += text[i] + '</c>'
  10.     else:
  11.         output += '<c=#'
  12.         output += '><c=#'.join(gradient)
  13.         output += '>'
  14.         size = int(math.ceil(leng / 3.0))
  15.         for i in range(1, 3+1):
  16.             output += text[(i-1)*size:i*size] + '</c>'
  17.     return output
  18. gradientmadness.command="absinthe"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement