Colors¶
kirons_py3_module.Colors is just a simple module I created which contains some colors, a rgb_to_hex converter and a hex_to_rgb
The colors (only very basic ones)¶
Colors I added to my kirons_py3_module.Colors module are just really basic ones, an more advanced one is https://ga17-ver.000webhostapp.com/meloonatic_downloads/rpg_tutorials/UltraColor.py which colors mostly aren’t supported by my rgb_to_hex and hex_to_rgb. Colors are:
- Black
- White
- Green
- Blue
- Red
- Yellow
- Magenta
- Cyan
I know there aren’t much, I told you.
RGB and HEX converters¶
rgb_to_hex(rgb) In this case rgb is just a tuple of 3 values between 0 and 255. 1st number = red, 2nd number = green, 3rd number = blue. It can’t be explained better. Example code:
from kirons_py3_module import *
r = 127
g = 0
b = 255
print(Colors.rgb_to_hex((r,g,b))) # Output: #7f00ff
hex_to_rgb(value) Opposite of rgb_to_hex. You give it an HEX color (for ex. #7f00ff), it gives you a tuple of 3 values between 0 and 255. 1st number = red, 2nd number = green, 3rd number = blue. Example code:
from kirons_py3_module import *
print(Colors.hex_to_rgb("#7f00ff")) # Output: (127, 0, 255)