/
live_demo.py
35 lines (26 loc) · 912 Bytes
/
live_demo.py
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
import pixelhouse as ph
from pixelhouse import *
from pixelhouse.filters import *
from pixelhouse.motion import *
from pixelhouse.transform import *
import numpy as np
pal = palette(15)
C = Animation(400, 400, bg=pal[0])
y = easeInOutQuad(-2, 2, flip=True)
def draw_circles(C):
C += circle(-2, y, r=0.40, color=pal[1])
C += circle(-1, -y, r=0.40, color=pal[2])
C += circle(1, y, r=0.40, color=pal[1])
C += circle(2, -y, r=0.40, color=pal[2])
draw_circles(C)
C += gaussian_blur(1.0, 1.0)
draw_circles(C)
with C.layer() as L:
theta = easeInOutQuad(0, 2 * np.pi)
L += rectangle(-0.5, -0.5, 0.5, 0.5, color=pal[3])
L += rotate(theta)
f_font = "../pixelhouse/fonts/Montserrat-Medium.otf"
g = ph.gradient.linear([pal[2], pal[3]])
C += text("H&&T presents", y=3, font_size=1.0, font=f_font, gradient=g)
C += text("pixelhouse", y=-3, font_size=1.0, font=f_font, gradient=g)
C.show()