kaleidoscope.py

Created by antarctus

Created on July 25, 2022

375 Bytes

Dégradé continu, de couleur en couleur.


from kandinsky import *
from random import *

def color():
  return tuple(randint(0,255) for i in range(3))

c=color()
while True:
  new_c=color()
  step=max([abs(new_c[i]-c[i]) for i in range(3)])
  coeff=[(new_c[i]-c[i])/step for i in range(3)]
  for i in range(step):
    fill_rect(0,0,320,222,tuple(int(c[j]+coeff[j]*i) for j in range(3)))
  c=new_c

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.