rgb_decode_v4.py

Created by wperez274

Created on August 20, 2022

822 Bytes

random colors with rgb decimal values.


from math import *
from random import *
from random import randint as R
from kandinsky import *
from ion import *
from time import *

def rgb_draw():
  fill_rect(0,0,322,222,"black")
  for i in range(0,200,20):
    RED=R(0,255)
    BLUE=R(0,255)
    GREEN=R(0,255)
    COLORS=(RED,GREEN,BLUE)
    sleep(0.1)
    fill_rect(0,i,322,18,(RED,GREEN,BLUE))#(R(0,255),R(0,255),R(0,255)))
    draw_string(str(COLORS),2,i,"black",(235,240,220))
  draw_string("Press [OK] or [EXE] key!",120,202,"black",(239,242,215))
sleep(0.2)

fill_rect(0,0,322,222,(0,0,140))
draw_string("Press key [OK] to draw",30,80,"black","cyan")
draw_string("Random list of Colors",30,100,"black","cyan")
draw_string("and their RGB values.",30,120,"black","cyan")
  
while 1:
  if keydown(KEY_OK) or keydown(KEY_EXE):
    rgb_draw()

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.