-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDraw Surendra.py
More file actions
executable file
·91 lines (74 loc) · 1.43 KB
/
Draw Surendra.py
File metadata and controls
executable file
·91 lines (74 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
from Processing import *
#SURENDRA PERSAUD
window (1000, 600)
background(255,255,255)
#red
rect(0,0,100,60)
fill(255,0,0)
#green
rect(100,0,100,60)
fill(0,255,0)
#blue
rect(200,0,100,60)
fill(0,0,255)
#yellow
rect(300,0,100,60)
fill(255,255,0)
#pink
rect(400,0,100,60)
fill(255,20,147)
#turquoise
rect(500,0,100,60)
fill(0,206,209)
#orange
rect(600,0,100,60)
fill(255,165,0)
#indigo
rect(700,0,100,60)
fill(75, 0, 130)
rect(800,0,100,60)
fill(0,0,0)
rect(900,0,100,60)
fill(0,0,0)
def colorbank():
if mouseX() <100:
fill(255,255,255)
elif mouseX() < 200:
fill(255,0,0)
elif mouseX() < 300:
fill(0,255,0)
elif mouseX() < 400:
fill(0,0,255)
elif mouseX() < 500:
fill(255,255,0)
elif mouseX() < 600:
fill(255,20,147)
elif mouseX() < 800:
fill(0,206,209)
elif mouseX() < 800:
fill(255,165,0)
elif mouseX() < 900:
fill(75, 0, 130)
elif mouseX() < 1000:
fill(0,0,0)
def draw():
noStroke()
if mouseY() > 80:
ellipse(mouseX(),mouseY(),50,50)
def paintBrush():
if mouseButton() == 1:
if mouseY() < 60:
colorbank()
if mouseY() > 60:
draw()
def mousePress():
if mouseButton() == 1:
print( "Mouse is pressed")
ellipse(mouseX(),mouseY(),50,50)
frameRate(500)
onLoop += paintBrush
loop()
frameRate(500)
if mouseButton() ==1:
onLoop += draw
loop()