Microsoft Small Basic

Program Listing: TCZ689
' Colorful Welcome ()
msg = "Welcome!"
len = Text.GetLength(msg)
x0 = 90
y0 = 130
fw = "W=0.90;e=0.54;l=0.26;c=0.54;o=0.60;m=0.88;!=0.26;"
fh = 100
ww = GraphicsWindow.Width
wh = GraphicsWindow.Height
GraphicsWindow.BrushColor = "Black"
next = Controls.AddButton("Draw", x0, 300)
GraphicsWindow.FontSize = fh
GraphicsWindow.FontBold = "True"
GraphicsWindow.FontName = "Arial"
Controls.ButtonClicked = OnButtonClicked

Sub OnButtonClicked
l = Math.GetRandomNumber(64)
GraphicsWindow.BrushColor = GraphicsWindow.GetColorFromRGB(l, l, l)
GraphicsWindow.FillRectangle(0 , 0, ww, wh)
x = x0
For i = 1 To len
GraphicsWindow.BrushColor = GraphicsWindow.GetRandomColor()
c = Text.GetSubText(msg, i, 1)
GraphicsWindow.DrawText(x, y0, c)
x = x + fw[c] * fh
EndFor
EndSub