mirror of
https://github.com/Xevion/processing-projects.git
synced 2025-12-06 11:16:01 -06:00
Illusion Colors project
This commit is contained in:
38
visuals/IllusionColors/IllusionColors.pyde
Normal file
38
visuals/IllusionColors/IllusionColors.pyde
Normal file
@@ -0,0 +1,38 @@
|
||||
import time
|
||||
|
||||
def setup():
|
||||
size(750, 750)
|
||||
frameRate(60)
|
||||
background(0)
|
||||
s = 0
|
||||
multi = 12.0
|
||||
|
||||
curColor = 0
|
||||
def nextColor():
|
||||
global curColor
|
||||
colors = [(255,0,0), (255, 127,0), (255,255,0), (0,255,0), (0,0,255), (75,0,130), (148,0,211)]
|
||||
curColor += 1
|
||||
return colors[curColor % len(colors)]
|
||||
|
||||
def draw():
|
||||
multi = 12.0
|
||||
s = 0
|
||||
for _ in range(int(12//0.3)):
|
||||
if multi <= 0:
|
||||
noLoop()
|
||||
time.sleep(1)
|
||||
s = 0
|
||||
multi = 12.0
|
||||
s += 1
|
||||
multi -= 0.3
|
||||
pushMatrix();
|
||||
translate(width/2,height/2);
|
||||
# rotate(s*radians(0.6));
|
||||
stroke(255)
|
||||
R, G, B = nextColor()
|
||||
stroke(R, G, B)
|
||||
fill(0, 0, 0)
|
||||
x1, y1, x2, y2, x3, y3 = -30*multi, 30*multi, 0, -30*multi, 30*multi, 30*multi
|
||||
# triangle(x1, y1, x2, y2, x3, y3);
|
||||
ellipse(0, 0, 100*multi, 100*multi)
|
||||
popMatrix();
|
||||
Reference in New Issue
Block a user