02-21-2011, 01:17 PM
I didn't plan on releasing this source as it took me a long time to work out for myself, but as It's from an old project of mine, I figured why not.
You should be able to work out whats going on, and it's very easy for you to add more colors.
Just stick all of that code into a button_click and you're done.
100% coding was done by me so if you use it, please give credits.
Colours (Click to View)
Code:
Try
Dim lol As New Random
Dim color(66) As String
color(0) = "Green"
color(1) = "Red"
color(2) = "Blue"
color(3) = "Pink"
color(4) = "Yellow"
color(5) = "White"
color(6) = "AliceBlue"
color(7) = "Darkorange"
color(8) = "DarkOrchid"
color(9) = "Cornflowerblue"
color(10) = "Cornsilk"
color(11) = "Crimson"
color(12) = "Cyan"
color(13) = "Darkblue"
color(14) = "Darkcyan"
color(15) = "Darkgoldenrod"
color(16) = "Darkgray"
color(17) = "Darkgreen"
color(18) = "Darkkhaki"
color(19) = "Darkmagenta"
color(20) = "Darkolivegreen"
color(21) = "Darkorange"
color(22) = "Darkorchid"
color(23) = "Darkred"
color(24) = "Darksalmon"
color(25) = "Darkseagreen"
color(26) = "Darkslateblue"
color(27) = "Darkslategray"
color(28) = "Darkturquoise"
color(29) = "Darkviolet"
color(30) = "Deeppink"
color(31) = "Deepskyblue"
color(32) = "Dimgray"
color(33) = "Dodgerblue"
color(34) = "Firebrick"
color(35) = "Floralwhite"
color(36) = "Forestgreen"
color(37) = "Fuchsia"
color(38) = "Magenta"
color(39) = "Maroon"
color(40) = "Mediumaquamarine"
color(41) = "Mediumblue"
color(42) = "Mediumorchid"
color(43) = "Mediumpurple"
color(44) = "Mediumseagreen"
color(45) = "Mediumslateblue"
color(46) = "Mediumspringgreen"
color(47) = "Mediumturquoise"
color(48) = "Mediumvioletred"
color(49) = "Midnightblue"
color(50) = "Gold"
color(51) = "Goldenrod"
color(52) = "Gray"
color(53) = "Green"
color(54) = "Greenyellow"
color(55) = "Blueviolet"
color(56) = "Brown"
color(57) = "Burlywood"
color(58) = "Cadetblue"
color(59) = "Chartreuse"
color(60) = "Chocolate"
color(61) = "Coral"
color(62) = "Crimson"
color(63) = "Hotpink"
color(64) = "Tomato"
color(65) = "Turquoise"
color(66) = "Violet"
Other (Click to View)
Code:
Dim input As String = txtBox.Text
Dim output As String = ""
For Each character As Char In input.ToCharArray()
If cboxForum.Checked = True Then
output += "[color=" + color(String.Format("{0}", lol.Next(0, 67))) + "]" & character.ToString() & "[/color]"
Else
output += "[c=" + lol.Next(0, 67).ToString() + "]" & character.ToString() & "[/c]"
End If
txtBox.Text = output
Next
Catch ex As Exception
End Try
You should be able to work out whats going on, and it's very easy for you to add more colors.
Just stick all of that code into a button_click and you're done.
100% coding was done by me so if you use it, please give credits.