Colori casuali: #RRGGBB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
GraphicsWindow.Height=GraphicsWindow.Width GraphicsWindow.PenWidth=25 Turtle.Speed=10 Turtle.Y=GraphicsWindow.Height/2 NUMERO=100 distanza=250 For i=1 to NUMERO GraphicsWindow.PenColor=GraphicsWindow.GetRandomColor() Turtle.PenDown() Turtle.Move(distanza) Turtle.PenUp() Turtle.Move(-distanza) distanza=distanza-2 Turtle.Turn(90+Math.GetRandomNumber(90)) EndFor |
Colori casuali, semitrasparenti: #99RRGGBB
1 2 |
c=GraphicsWindow.GetRandomColor() GraphicsWindow.PenColor="#99"+Text.GetSubText(c,2,6) |
Il colore va dal blue (0,0,255) al magenta (255,0,255)
1 2 |
red=Math.GetRandomNumber(255) GraphicsWindow.PenColor=GraphicsWindow.GetColorFromRGB(red,0,255) |
Un colore a piacere, semitrasparente
1 |
GraphicsWindow.PenColor="#330000FF" |
…