couleur.py

Created by antarctus

Created on June 07, 2021

679 Bytes

Trouver la couleur qu’il vous faut avec cette palette interactive. Utiliser les boutons aux extrémités du clavier du haut (celui qui est large de six touches) et obtenez le code hexadécimal de votre couleur.


from kandinsky import *
from ion import *
from time import *

r=0
v=0
b=0

def get_touche():
  global r,v,b
  r=(r+10*(keydown(KEY_BACKSPACE)-keydown(KEY_SHIFT)))%260
  v=(v+10*(keydown(KEY_POWER)-keydown(KEY_EXP)))%260
  b=(b+10*(keydown(KEY_SQUARE)-keydown(KEY_SINE)))%260

while True:
  fill_rect(0,0,320,162,(r,v,b))
  get_touche()
  sleep(0.1)
  for i in range(0,25):
    fill_rect(i*10,162,10,20,(i*10,v,b))
  for i in range(0,25):
    fill_rect(i*10,182,10,20,(r,i*10,b))
  for i in range(0,25):
    fill_rect(i*10,202,10,20,(r,v,i*10))
  draw_string("  "+str(r)+"  ",250,162)
  draw_string("  "+str(v)+"  ",250,182)
  draw_string("  "+str(b)+"  ",250,202)

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.