rgb_helper.py

Created by philippelestro

Created on September 23, 2023

2.73 KB

English below

Script facile à utiliser pour convertir n’importe quelle couleur en rgb/rgb en couleur. Les contrôles s’affichent quand vous démarrez le script. Le script est en anglais. Pour me contacter, envoyez moi un DM sur discord, mon nom d’utilisateur est philipou (le script ne marche pas dans l’émulateur)

Easy to use script to convert any color to rgb/rgb to color. Controls show up when you start the script. The script is in english. To contact me, DM me on discord, my username is philipou (the script doesn’t work in the emulator)


print("""















""")
if input("Press 1 and EXE/OK to load a color\npress EXE/OK to load normally : ") == "1":
    r = input("Red : ")
    g = input("Green : ")
    b = input("Blue : ")
    try:
      r = int(r)
      g = int(g)
      b = int(b)
    except Exception:
      while True:
        print("ERROR DETECTED, CHECK IF INPUT IS CORRECT")
else:
  r = 0
  g = 0
  b = 0
  
print("""
/------------CONTROLS/HELP--------------\ 
| ( : Red -     -> : All colors +       |
| ) : Red +     <- : All colors -       |
| * : Green -  shift:update screen/start|
| / : Green +  9:reset Red              |
| + : Blue -   6:reset Green            |
| - : Blue +   3:reset Blue             |
| OK : reset color to black (RGB 0 0 0) |
| EXE : close and print RGB in console  |
| Press/hold shift to start             |
|                                       |
| Script by Philipou                    |
| Discord : philipou                    |
\---------------------------------------/""")
from math import *
from kandinsky import *
from ion import *
from time import *
def update():
  fill_rect(235,0,210,87,color(255,255,255)) 
  draw_string("R = {}".format(r),235,15)
  draw_string("G = {}".format(g),235,35)
  draw_string("B = {}".format(b),235,55)
  fill_rect(0,0,210,222,color(r,g,b))
#  fill_rect(210,88,200,200,color(r,g,b))
  fill_rect(220,100,80,20,color(r,0,0))
  fill_rect(220,140,80,20,color(0,g,0))
  fill_rect(220,180,80,20,color(0,0,b))
def delay(time=0.05):
  sleep(time)
while True:
  if keydown(KEY_LEFTPARENTHESIS):
    r -= 1
    update()
    delay()
  if keydown(KEY_RIGHTPARENTHESIS):
    r += 1
    update()
    delay()
  if keydown(KEY_MULTIPLICATION):
    g -= 1
    update()
    delay()
  if keydown(KEY_DIVISION):
    g += 1
    update()
    delay()
  if keydown(KEY_PLUS):
    b -= 1
    update()
    delay()
  if keydown(KEY_MINUS):
    b += 1
    update()
    delay()
  if keydown(KEY_RIGHT):
    r += 1
    g += 1
    b += 1
    update()
    delay()
  if keydown(KEY_LEFT):
    r -= 1
    g -= 1
    b -= 1
    update()
    delay()
  if r < 0:
    r = 255
    update()
  if r > 255:
    r = 0
    update()
  if g < 0:
    g = 255
    update()
  if g > 255:
    g = 0
    update()
  if b < 0:
    b = 255
    update()
  if b > 255:
    b = 0
    update()
  if keydown(KEY_SHIFT):
    update()
  if keydown(KEY_NINE):
    r = 0
    update()
  if keydown(KEY_SIX):
    g = 0
    update()
  if keydown(KEY_THREE):
    b = 0
    update()
  if keydown(KEY_EXE):
    print("""
    
    
    
    
    
    
    
    
    
    
    
    
    """)
    print("RGB :")
    print(r,g,b)
    fill_rect(0,0,320,322,color(255,255,255))
    draw_string("Press OK to quit",80,100)
    break
  if keydown(KEY_OK):
    r = 0
    g = 0
    b = 0
    update()
    

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.