SHOW:
|
|
- or go back to the newest paste.
| 1 | """ | |
| 2 | For this file to work properly, you should please read all the comments. | |
| 3 | Comments are enclosed in " " " marks (without spaces), like this one. | |
| 4 | ||
| 5 | Place this file in the Pesterchum quirks folder, which is usually | |
| 6 | C:\Pesterchum\quirks for Windows. | |
| 7 | Remember to set the file type as "All" and the extension to .py | |
| 8 | ||
| 9 | Please read thoroughly. | |
| 10 | If you have any questions, ask someone who knows about gradients. | |
| 11 | """ | |
| 12 | from math import ceil | |
| 13 | ||
| 14 | gradient = ('COLOR 1', 'COLOR 2')
| |
| 15 | colors = len(gradient) | |
| 16 | """ | |
| 17 | Put the colors you want up there, in CORRECT order. They must be in RRGGBB HEXADECIMAL format. | |
| 18 | If you don't know what that is, look it up on Google and have your color values converted there. | |
| 19 | ||
| 20 | Remember to enclose each color value in single quotes and separate the color values with commas. | |
| 21 | - | colors = 2 |
| 21 | + | |
| 22 | ||
| 23 | - | Change this value to the number of colors you have in your gradient. |
| 23 | + | |
| 24 | - | If this number does not match the number of colors you have entered in the gradient, |
| 24 | + | |
| 25 | - | it will either show up as incomplete or cause an error. |
| 25 | + | |
| 26 | ||
| 27 | if leng < colors: | |
| 28 | for i in range(0, leng): | |
| 29 | output += '<c=#%s>' % gradient[colors - 1 - i] | |
| 30 | for i in range(0, leng): | |
| 31 | output += text[i] + '</c>' | |
| 32 | else: | |
| 33 | for i in range(0, colors): | |
| 34 | output += '<c=#' + gradient[colors - 1 - i] + '>' | |
| 35 | ||
| 36 | size = int(ceil(leng / float(colors))) | |
| 37 | for i in range(1, colors + 1): | |
| 38 | output += text[(i-1)*size:i*size] + '</c>' | |
| 39 | ||
| 40 | return output | |
| 41 | """ | |
| 42 | Don't do anything to this part of the code unless you know what you're doing. | |
| 43 | You'll break the gradient function. | |
| 44 | """ | |
| 45 | ||
| 46 | ||
| 47 | gradientmadness.command="gradientname" | |
| 48 | """ | |
| 49 | Between the double quotes above, insert the name of your gradience function | |
| 50 | ||
| 51 | To use in the quirks menu: | |
| 52 | regex replace ^(.*)$ | |
| 53 | and replace it with | |
| 54 | gradientname(\1) | |
| 55 | ||
| 56 | where gradientname is the name entered in the double quotes. | |
| 57 | ||
| 58 | Remember to click the RELOAD FUNCTIONS button | |
| 59 | so that it will appear in the functions list | |
| 60 | and to test if you did it right. | |
| 61 | ||
| 62 | There will be no error messages if you edited this file correctly. | |
| 63 | Don't forget to click FINISH then OK when you're done. | |
| 64 | If you want to test it, use the QUIRK TEST button so | |
| 65 | you don't flood memos or chats. | |
| 66 | """ |