Forum Settings
Forums
New
Dec 2, 2013 9:32 PM
#1
Nobody

Offline
Jul 2013
12165
I wasn't sure where to ask this so I thought this would be the best place.

I'm wondering if there is a way to make some text for the about me section to be rainbow or multi colored. I don't want to have to spend ages doing coding like this:

[ color=red ]t[ /color ][ color=blue ]e[ /color ][ color=green ]x[ /color ][ color=pink ]t[ /color ]
(makes this: text)

Really I'm wondering what would be the easiest way of doing this?

Dec 2, 2013 9:58 PM
#2

Offline
Apr 2007
1993
<?php

$colors = array("red","orange","goldenrod","green","blue","purple");
$text = "Whatever the hell text you want";
$texts = str_split($text);

$i = 0;
for($i = 0; $i < strlen($text); $i++){
echo "[color=" . $colors[$i%count($colors)] . "]" . $texts[$i] . "[/color]";
}


I wrote up a pretty simple php script to do this -

Whatever the hell text you want

Replace "Whatever the hell text you want" with whatever text you want rainbowified. Then go to http://codepad.org/, select 'PHP' as the language, paste all that code into the box, and hit run. The BBCode should be there under 'output', like so: http://codepad.org/KBbhBsLH
Dec 2, 2013 10:39 PM
#3
Nobody

Offline
Jul 2013
12165
Thankyou. That was exactly what I was looking for.
Dec 3, 2013 2:32 AM
#4

Offline
Apr 2007
1993
You're welcome.

This is probably unnecessary but I modified the code a little because I realized it was still putting color tags around spaces:


<?php

$colors = array("red","orange","goldenrod","green","blue","purple");
$text = "Whatever the hell text you want";
$texts = str_split($text);

for($i = 0; $i < strlen($text); $i++){
if($texts[$i]!=" "){
echo "[color=" . $colors[$i%count($colors)] . "]" . $texts[$i] . "[/color]";
}
else{
echo " ";
}
}


You can also modify the colors to your choosing, just change "red","orange","goldenrod", etc to whatever colours you want as long as they're html valid color names. You can have as many as you want. For example,

$colors = array("crimson", "coral", "khaki", "teal", "hotpink", "violet","black","mediumblue");
Apr 23, 2020 1:58 PM
#5

Offline
Oct 2018
402
I can't get it to work :(
How do I make rainbow text?
The other forum I use is easy, I just type [rainbow]words and stuff here[/rainbow]
████████▀▀░░░░░░░░░░░░░░░░░░░▀▀███████
██████▀░░░░░░░░░░░░░░░░░░░░░░░░░▀██████
█████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█████
████░░░░░▄▄▄▄▄▄▄░░░░░░░░▄▄▄▄▄▄░░░░░████
████░░▄██████████░░░░░░██▀░░░▀██▄░░████
████░░███████████░░░░░░█▄░░▀░░▄██░░████
█████░░▀▀███████░░░██░░░██▄▄▄█▀▀░░█████
██████░░░░░░▄▄▀░░░████░░░▀▄▄░░░░░██████
█████░░░░░█▄░░░░░░▀▀▀▀░░░░░░░█▄░░░█████
█████░░░▀▀█░█▀▄▄▄▄▄▄▄▄▄▄▄▄▄▀██▀▀░░█████
██████░░░░░▀█▄░░█░░█░░░█░░█▄▀░░░░██▀▀▀▀
▀░░░▀██▄░░░░░░▀▀█▄▄█▄▄▄█▄▀▀░░░░▄█▀░░░▄▄
▄▄▄░░░▀▀██▄▄▄▄░░░░░░░░░░░░▄▄▄███░░░▄██▄
██████▄▄░░▀█████▀█████▀██████▀▀░░▄█████
██████████▄░░▀▀█▄░░░░░▄██▀▀▀░▄▄▄███▀▄██
Apr 23, 2020 2:40 PM
#6

Offline
Feb 2010
11294
NO_U_ETC said:
I can't get it to work :(
How do I make rainbow text?
The other forum I use is easy, I just type [rainbow]words and stuff here[/rainbow]


In Step 2, use Colors of the Rainbow
https://www.stuffbydavid.com/textcolorizer

This is one of many BBcode tricks I have here
https://myanimelist.net/forum/?topicid=419453

Apr 23, 2020 2:49 PM
#7

Offline
Oct 2018
402
Shishio-kun said:
NO_U_ETC said:
I can't get it to work :(
How do I make rainbow text?
The other forum I use is easy, I just type [rainbow]words and stuff here[/rainbow]


In Step 2, use Colors of the Rainbow
https://www.stuffbydavid.com/textcolorizer

This is one of many BBcode tricks I have here
https://myanimelist.net/forum/?topicid=419453


Awesome, it worked!
I've been doing this the hard way up until now XD
I'm going to have a lot of fun with this!
Thanks you so much :D
████████▀▀░░░░░░░░░░░░░░░░░░░▀▀███████
██████▀░░░░░░░░░░░░░░░░░░░░░░░░░▀██████
█████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█████
████░░░░░▄▄▄▄▄▄▄░░░░░░░░▄▄▄▄▄▄░░░░░████
████░░▄██████████░░░░░░██▀░░░▀██▄░░████
████░░███████████░░░░░░█▄░░▀░░▄██░░████
█████░░▀▀███████░░░██░░░██▄▄▄█▀▀░░█████
██████░░░░░░▄▄▀░░░████░░░▀▄▄░░░░░██████
█████░░░░░█▄░░░░░░▀▀▀▀░░░░░░░█▄░░░█████
█████░░░▀▀█░█▀▄▄▄▄▄▄▄▄▄▄▄▄▄▀██▀▀░░█████
██████░░░░░▀█▄░░█░░█░░░█░░█▄▀░░░░██▀▀▀▀
▀░░░▀██▄░░░░░░▀▀█▄▄█▄▄▄█▄▀▀░░░░▄█▀░░░▄▄
▄▄▄░░░▀▀██▄▄▄▄░░░░░░░░░░░░▄▄▄███░░░▄██▄
██████▄▄░░▀█████▀█████▀██████▀▀░░▄█████
██████████▄░░▀▀█▄░░░░░▄██▀▀▀░▄▄▄███▀▄██

More topics from this board

» People who don't believe that there is anything wrong with western entertainment and influence.

kratos960203 - Apr 19

28 by Ex-Aid »»
6 hours ago

» Made An Anime Youtube Video thoughts?

panque - Yesterday

1 by TheMechaManiac »»
Yesterday, 11:43 AM

» Share Your YouTube Channel/Videos! ( 1 2 3 4 5 ... Last Page )

nin-tendo - Dec 16, 2022

361 by panque »»
Yesterday, 8:38 AM

» Anime hoodies - New brand

abambata - Apr 13

3 by abambata »»
Yesterday, 7:47 AM

» Anime hoodies - Would you wear it ?

abambata - Apr 17

3 by abambata »»
Yesterday, 7:46 AM
It’s time to ditch the text file.
Keep track of your anime easily by creating your own list.
Sign Up Login