Rejected - Rainbowfied text | Kinmunity: Otherkin Community

Rejected Rainbowfied text

Discussion in 'Suggestion Box' started by kiror, Jul 6, 2015.

Thread Status:
Not open for further replies.
  1. kiror

    kiror Fuzzy Mirror
    Staff Member Deputy Admin Elder VIP

    Joined:
    Jun 5, 2015
    Messages:
    490
    Trophy Points:
    62
    Bones:
    Ƀ74.70
    Primary Identity:
    Polymorph
    Mood:
    :sleeping:
    This one may have a very good acceptance between the kinmunity members. The code is written in python3 (the fastest way I implemented it).
    To the code:
    Code:
    #!/usr/bin/python3
    # -*- coding: utf-8 -*-
    
    from sys import argv as argv
    
    lbbc=[]
    
    def initListOfColors():
        global lbbc
        lbbc=[]
        for i in range(0,256):
            lbbc+=[[255-i,i,0]]
        for i in range(0,256):
            lbbc+=[[0,255-i,i]]
        lbbc=["{:02x}".format(k[0])+
              "{:02x}".format(k[1])+
              "{:02x}".format(k[2]) for k in lbbc]
        return #len(lbbc)==512
    
    def bbcode_txt_lolcat(text):
        o=""
        traveler=20
        for i in range(len(text)):
            o+="[COLOR=#"+lbbc[(i*traveler)%len(lbbc)]+"]"+text[i]+"[/COLOR]"
        return o
    
    def main():
        if len(argv)!=2:
            print("This program takes only one argument.")
        else:
            initListOfColors()
            txt=argv[1]
            o=bbcode_txt_lolcat(txt)
            print(o)
        return
    
    if __name__=="__main__":
        main()
    
    Bugfixed:
    Code:
    #!/usr/bin/python3
    # -*- coding: utf-8 -*-
    
    from sys import argv as argv
    
    lbbc=[]
    
    def initListOfColors():
        global lbbc
        lbbc=[]
        for i in range(0,256):
            lbbc+=[[255-i,i,0]]
        for i in range(0,256):
            lbbc+=[[0,255-i,i]]
        for i in range(0,256):
            lbbc+=[[i,0,255-i]]
        lbbc=["{:02x}".format(k[0])+
              "{:02x}".format(k[1])+
              "{:02x}".format(k[2]) for k in lbbc]
        return;
        #len(lbbc)==768
    
    
    def bbcode_txt_lolcat(text):
        o=""
        traveler=20
        for i in range(len(text)):
            o+="[COLOR=#"+lbbc[(i*traveler)%len(lbbc)]+"]"+text[i]+"[/COLOR]"
        return o
    
    def main():
        if len(argv)!=2:
            print("This program takes only one argument.")
        else:
            initListOfColors()
            txt=argv[1]
            o=bbcode_txt_lolcat(txt)
            print(o)
        return
    
    if __name__=="__main__":
        main()
    
    Bugfix in rainbow (before and after):
    ###################################################
    ###################################################

    How I used it via terminal:
    user@domain:~/Documents/bbcode/rainbowfy$ python3 rbfy.py "This one may have a very good acceptance between the kinmunity members. The code is written in python3 (the fastest way I implemented it)."
     
    #1 kiror, Jul 6, 2015
    Last edited by a moderator: Jul 6, 2015
    • Like Like x 3
  2. Raijun

    Raijun Now with 40% less almond
    VIP Hiatus

    Joined:
    Jun 17, 2015
    Messages:
    246
    Trophy Points:
    10
    Bones:
    Ƀ32.00
    Primary Identity:
    Changling
    That is pretty impressive. My one and only conceivable gripe with this would be that it's occasionally hard to read against the forum posts' colors. I use the dark skin myself, and the blue range kind of fades out against it.

    But it's wicked cool regardless. Three and a half thumbs up! (ew)
     
  3. Shiro

    Shiro The foxy wolfeh ;p
    Staff Member Administrator

    Joined:
    Dec 15, 2014
    Messages:
    1,273
    Trophy Points:
    100
    Standard Media KeyWuffyChibi WolfGold Theta DeltaSilver Werewolf CoinGold Wolf CoinBrimstone DemonRed KitsuneBarghestWonder WolfChibi FoxGold PawBronze Fox Coin
    Bones:
    Ƀ38,278.36
    Primary Identity:
    Therian/Were
    Mood:
    :relaxed:
    Considering we already have to discourage the use of excessive coloring for readability in introduction posts and similar, this suggestion isn't going to be implemented.
     
Thread Status:
Not open for further replies.