Advertisement
LuaDotExe

Red-Blue Gradient

Mar 16th, 2017
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.63 KB | None | 0 0
  1. import math
  2. RedBlueList = ('ff0000','ff0048','ff008b','ff00b9','ff00e6','eb00ff','be00ff','9100ff','6400ff','2000ff')
  3. def RedBlue(text):
  4.     x = 10
  5.     leng = len(text)
  6.     output = ''
  7.     if leng < x:
  8.         for i in range(0, leng):
  9.             output += '<c=#%s>' % RedBlueList[i]
  10.         for i in range(0, leng):
  11.             output += text[i] + '</c>'
  12.     else:
  13.         output += '<c=#'
  14.         output += '><c=#'.join(RedBlueList)
  15.         output += '>'
  16.         size = int(math.ceil(leng / x+1))
  17.         for i in range(1, x+1):
  18.             output += text[(i-1)*size:i*size] + '</c>'
  19.     return output
  20. RedBlue.command="RedToBlue"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement