rgbselector5.py

Created by wperez274

Created on February 01, 2023

1.25 KB

Color select and prints rgb values for using in scripts. Just have to use Up arrow key to go up Hold [Shift) & Highlight tuple, [Navigation] (arrow) keys.

Paste it wherever to want to use it. This is a cool tool with no bools or fools. No class but still badass. This spaghetti code can make you more bold.

example:

from kandinsky import *

fill_rect(0,0,322,222,(23,56,67))

the last argument (a tuple) could have been discovered with this script.

Instructions on screen.


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






EXIT=False




c=(R(0,255),R(0,255),R(0,255))

def randColor():
  global c

  fill_rect(0,0,322,120,c)

  fill_rect(0,0,322,3,(0,0,0))
  fill_rect(0,120,322,3,(0,0,0))


  


  fill_rect(0,124,322,100,'white')

  draw_string("(r,g,b) = "+str(c),30,130)

  

randColor()

while not EXIT:
  



  if keydown(KEY_OK):
    sleep(0.2)
    c=(R(0,255),R(0,255),R(0,255))
    randColor()



  if keydown(KEY_UP):
    sleep(0.2)
    c=(R(0,55),R(0,55),R(0,55))
    randColor()


  if keydown(KEY_RIGHT):
    sleep(0.2)
    c=(R(100,255),R(0,155),R(0,155))
    randColor()


  if keydown(KEY_DOWN):
    sleep(0.2)
    c=(R(0,155),R(100,255),R(0,155))
    randColor()

  if keydown(KEY_LEFT):
    sleep(0.2)
    c=(R(0,155),R(0,155),R(100,255))
    randColor()



    
  if keydown(KEY_EXE) or keydown(KEY_BACKSPACE):
    draw_string("Color selected.",40,30)
  
    draw_string("    PRESS [OK] TO EXIT       ",0,65,(0,0,0),(255,255,0))
    
    EXIT=True
    
  
  
  draw_string("[ARROWS],[OK] = RANDOM ALL",20,200)  
  
  draw_string("[EXE],[BACKSPACE] key = Select",4,170,'black',(0,255,255))  
  
      
      

print(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.