from math import * from kandinsky import * from kandinsky import fill_rect as FILL from kandinsky import draw_string as STR from ion import * from time import * from random import * R=255 G=255 B=0 #R_2=randint(0,255) #G_2=randint(0,255) #B_2=randint(0,255) #RGB=(R_2,G_2,B_2) selector_x = 4 selector_y = 129 FILL(92,120,322-92,222-120,"black") FILL(0,2,322,118,(R,G,B)) while 1: if keydown(KEY_RIGHT) and selector_y==129: sleep(0.2) R+=1 FILL(40,124,40,18,"white") if keydown(KEY_LEFT) and selector_y==129: sleep(0.2) R-=1 FILL(40,124,40,18,"white") if keydown(KEY_RIGHT) and selector_y==147: sleep(0.2) G+=1 FILL(40,142,40,18,"white") if keydown(KEY_LEFT) and selector_y==147: sleep(0.2) G-=1 FILL(40,142,40,18,"white") if keydown(KEY_RIGHT) and selector_y==165: sleep(0.2) B+=1 FILL(40,160,40,18,"white") if keydown(KEY_LEFT) and selector_y==165: sleep(0.2) B-=1 FILL(40,160,40,18,"white") if R>255: R=255 if R<0: R=0 if G>255: G=255 if G<0: G=0 if B>255: B=255 if B<0: B=0 if keydown(KEY_DOWN) and selector_y==129: selector_y=147 FILL(selector_x,124,14,12,"white") sleep(0.2) if keydown(KEY_DOWN) and selector_y==147: selector_y=165 FILL(selector_x,147,14,12,"white") sleep(0.2) if keydown(KEY_DOWN) and selector_y==165: selector_y=183 FILL(selector_x,165,14,12,"white") sleep(0.2) if keydown(KEY_UP) and selector_y==183: selector_y=165 FILL(selector_x,178,14,12,"white") sleep(0.2) if keydown(KEY_UP) and selector_y==165: selector_y=147 FILL(selector_x,160,14,12,"white") sleep(0.2) if keydown(KEY_UP) and selector_y==147: selector_y=129 FILL(selector_x,142,14,12,"white") sleep(0.2) # single random R,G,B values if keydown(KEY_OK) and selector_y==129 or keydown(KEY_EXE) and selector_y==129: sleep(0.15) R=randint(0,255) FILL(0,2,322,118,(R,G,B)) FILL(38,125,32,50,"white") if keydown(KEY_OK) and selector_y==147 or keydown(KEY_EXE) and selector_y==147: sleep(0.15) G=randint(0,255) FILL(0,2,322,118,(R,G,B)) FILL(38,143,32,50,"white") if keydown(KEY_OK) and selector_y==165 or keydown(KEY_EXE) and selector_y==165: sleep(0.15) B=randint(0,255) FILL(0,2,322,118,(R,G,B)) FILL(38,161,32,50,"white") if keydown(KEY_OK) and selector_y==183 or keydown(KEY_EXE) and selector_y==183: sleep(0.15) R=randint(0,255) G=randint(0,255) B=randint(0,255) R_2=randint(0,255) G_2=randint(0,255) B_2=randint(0,255) RGB=(R_2,G_2,B_2) FILL(0,2,322,118,(R,G,B)) FILL(38,125,32,50,"white") FILL(38,143,32,50,"white") FILL(38,161,32,50,"white") #backspace resets value #to zero if keydown(KEY_BACKSPACE) and selector_y==129: sleep(0.15) FILL(38,125,32,50,"white") R=0 #R_2=255 #RGB=(R_2,G_2,B_2) FILL(0,2,322,118,(R,G,B)) if keydown(KEY_TOOLBOX) and selector_y==129: sleep(0.15) FILL(38,125,32,50,"white") R=255 #R_2=255 #RGB=(R_2,G_2,B_2) FILL(0,2,322,118,(R,G,B)) if keydown(KEY_BACKSPACE) and selector_y==147: sleep(0.15) FILL(38,125,32,50,"white") G=0 #G_2=255 #RGB=(R_2,G_2,B_2) FILL(0,2,322,118,(R,G,B)) if keydown(KEY_TOOLBOX) and selector_y==147: sleep(0.15) FILL(38,125,32,50,"white") G=255 #G_2=255 #RGB=(R_2,G_2,B_2) FILL(0,2,322,118,(R,G,B)) if keydown(KEY_BACKSPACE) and selector_y==165: sleep(0.15) FILL(38,125,32,50,"white") B=0 #B_2=255 #RGB=(R_2,G_2,B_2) FILL(0,2,322,118,(R,G,B)) if keydown(KEY_TOOLBOX) and selector_y==165: sleep(0.15) FILL(38,125,32,50,"white") B=255 #B_2=255 #RGB=(R_2,G_2,B_2) FILL(0,2,322,118,(R,G,B)) if keydown(KEY_BACKSPACE) and selector_y==183: sleep(0.15) R,G,B = 0,0,0 FILL(38,125,32,50,"white") FILL(0,2,322,118,(R,G,B)) if keydown(KEY_TOOLBOX) and selector_y==183: sleep(0.15) FILL(38,125,32,50,"white") R=G=B = 255 #R_2=randint(0,255) #G_2=randint(0,255) #B_2=randint(0,255) #RGB=(R_2,G_2,B_2) FILL(0,2,322,118,(R,G,B)) FILL(selector_x,selector_y,6,6,"black") FILL(0,0,322,3,"cyan") FILL(0,119,322,3,"cyan") STR("[OK]: Randomize RGB",95,125,(255,255,255),(0,0,0)) STR("Left/Right:Value -/+",97,143,(255,255,255),(0,0,0)) STR("Toolbox: set to 255",97,161,(255,255,255),(0,0,0)) STR("Up/Down: Selector Move",97,179,(255,255,255),(0,0,0)) STR("Backspace: Reset to 0",97,197,(255,255,255),(0,0,0)) STR("R:"+str(R),18,124,"red","white") STR("G:"+str(G),18,142,(0,150,0),"white") STR("B:"+str(B),18,160,"blue","white") STR("Random",18,178,"black","cyan") STR("all.",18,196,"black","cyan")