Skip to content

Instantly share code, notes, and snippets.

@samclane
Last active July 6, 2019 06:13
Show Gist options
  • Save samclane/28355d0d9161b32445521719be3b8165 to your computer and use it in GitHub Desktop.
Save samclane/28355d0d9161b32445521719be3b8165 to your computer and use it in GitHub Desktop.
import numpy as np
import pixelhouse as ph
WIDTH = 255
HEIGHT = 255
COLOR = "#6639B7"
CIRCLE_SCALE_FACTOR = 1/65
def logo_animation():
A = ph.Animation(fps=60, duration=1.5, width=WIDTH, height=HEIGHT, bg=COLOR)
A += ph.circle(x=0, y=0, r=CIRCLE_SCALE_FACTOR * 225, color="white")
A += ph.circle(x=0, y=0, r=CIRCLE_SCALE_FACTOR * 188, color=COLOR)
# theta = ph.motion.easeInOutCirc(np.pi/4, (3/4)*np.pi, flip=True)
theta = ph.motion.easeInOutCubic(1/5*np.pi, (3/4)*np.pi, flip=True)
for i in np.arange(np.pi/3, (3/8)*np.pi, np.pi/12):
A += ph.ellipse(x=0, y=CIRCLE_SCALE_FACTOR * -255,
a=CIRCLE_SCALE_FACTOR * 225, b=CIRCLE_SCALE_FACTOR * 225,
angle_start= np.pi/4.365, angle_end=(i*theta),
color="white", thickness=CIRCLE_SCALE_FACTOR*30)
return A
if __name__ == '__main__':
logo_animation().show()
# ph.canvas2gif(logo_animation(), r"PATH")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment