Advertisement
LuaDotExe

Green To Black Gradient

Mar 8th, 2016
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.65 KB | None | 0 0
  1. import math
  2.  
  3. GreenToBlack = ('000000','000A05','00140B','001F10','002E18','00381D','004524','004F29','005E31','006B38','007D41')
  4.  
  5. def Greentoblack(text):
  6.     leng = len(text)
  7.     output = ''
  8.     if leng < 11:
  9.         for i in range(0, leng):
  10.             output += '<c=#%s>' % GreenToBlack[i]
  11.         for i in range(0, leng):
  12.             output += text[i] + '</c>'
  13.     else:
  14.         output += '<c=#'
  15.         output += '><c=#'.join(GreenToBlack)
  16.         output += '>'
  17.         size = int(math.ceil(leng / 11.0))
  18.         for i in range(1, 12):
  19.             output += text[(i-1)*size:i*size] + '</c>'
  20.     return output
  21. Greentoblack.command="GreenToBlack"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement