Graphics 800,600,16,2
Global w
Global x=255
Global y
AppTitle "Drawing"
Color 255,255,255
Line 1,500,800,500
Color 0,0,255
Rect 1,520,50,50,1
Text 20,580, "1"
Color 255,0,0
Rect 61,520,50,50,1
Text 80,580, "2"
Color 0,255,0
Rect 121,520,50,50,1
Text 140,580, "3"
Color 255,255,255
Rect 181,520,50,50,1
Text 200,580, "4"
Color 255,0,255
Rect 241,520,50,50,1
Text 260,580, "5"
Color 0,255,255
Rect 301,520,50,50,1
Text 320,580, "6"
Color 255,255,0
Rect 361,520,50,50,1
Text 380,580, "7"
Color 255,255,255
Text 421,520, "BSP-Clear Screen"
Text 421,532, "ESC-Quit"
Text 575,510, "Current Color:"
Color 255,255,255
Rect 590,530,60,60,1
Color 0,0,255
Rect 595,535,50,50,1
While Not KeyDown(1)
While MouseDown(1) And MouseY()<490
Color w,y,x
If KeyHit(2) Then
x=255
w=0
y=0
Color 0,0,255
Rect 595,535,50,50,1
EndIf
If KeyHit(3) Then
x=0
w=255
y=0
Color 255,0,0
Rect 595,535,50,50,1
EndIf
If KeyHit(4) Then
x=0
w=0
y=255
Color 0,255,0
Rect 595,535,50,50,1
EndIf
If KeyHit(5) Then
x=255
w=255
y=255
Color 255,255,255
Rect 595,535,50,50,1
EndIf
If KeyHit(6) Then
x=255
w=255
y=0
Color 255,0,255
Rect 595,535,50,50,1
EndIf
If KeyHit(7) Then
x=255
w=0
y=255
Color 0,255,255
Rect 595,535,50,50,1
EndIf
If KeyHit(8) Then
x=0
w=255
y=255
Color 255,255,0
Rect 595,535,50,50,1
EndIf
Oval MouseX(),MouseY(),10,10,1
Wend
If KeyHit(14) Then
Cls
Color 255,255,255
Line 1,500,800,500
Color 0,0,255
Rect 1,520,50,50,1
Text 20,580, "1"
Color 255,0,0
Rect 61,520,50,50,1
Text 80,580, "2"
Color 0,255,0
Rect 121,520,50,50,1
Text 140,580, "3"
Color 255,255,255
Rect 181,520,50,50,1
Text 200,580, "4"
Color 255,0,255
Rect 241,520,50,50,1
Text 260,580, "5"
Color 0,255,255
Rect 301,520,50,50,1
Text 320,580, "6"
Color 255,255,0
Rect 361,520,50,50,1
Text 380,580, "7"
Color 255,255,255
Text 421,520, "BSP-Clear Screen"
Text 421,532, "ESC-Quit"
Text 575,510, "Current Color:"
Color w,y,x
Rect 595,535,50,50,1
EndIf
Wend
End
This better.