Converts back and forth between different color formats [(255,0,0),#ff0000, 16711680,(255,0,255) ... ]
Project description
Converts back and forth between different color formats [(255,0,0),#ff0000, 16711680,(255,0,255) ... ]
pip install fabisschomagut
Tested against Windows 10 / Python 3.10 / Anaconda
How to use it
# Converting from one color format to another
from fabisschomagut import subtract_color,add_color,to_rgb_hex,to_rgba_hex,to_rgba_tuple,to_rgb_tuple
print(to_rgb_tuple(color="red"))
print(to_rgba_tuple(color=(255, 0, 0)))
print(to_rgb_hex(color="#ff0000"))
print(to_rgba_hex(color="0xFF0000"))
print(to_rgb_tuple(color=0xFF0000, invert=True))
print(to_rgba_tuple(color="red", invert=True))
print(to_rgb_hex(color="red", invert=True))
print(to_rgba_hex(color=(255, 0, 0), invert=True))
print(to_rgb_tuple(color="blue", invert=True))
print(to_rgba_tuple(color=(0, 255, 0), invert=True))
print(to_rgb_hex(color="ff0000", invert=False))
print(to_rgba_hex(color="#FFF000", invert=False))
print(to_rgb_tuple(color="BLUE", invert=False))
print(add_color(color1="BLUE", color2=(0, 255, 0), invert=False))
print(subtract_color(color1="pink", color2="#200000", invert=False))
print(to_rgb_hex(color=16746513, invert=False))
print(subtract_color(color1="pink", color2="0x200000", invert=False))
print(subtract_color(color1="ffc0cb", color2=0x200000, invert=False))
print(subtract_color(color1=0xFFC0CB, color2="#200000", invert=True))
print(to_rgb_hex(subtract_color(color1="pink", color2="200000", invert=True)))
# (255, 0, 0)
# (255, 0, 0, 255)
# 0xff0000
# (255, 0, 0, 255)
# 0xff0000ff
# #FF0000
# (0, 0, 255)
# (0, 0, 255, 255)
# 0x0000ff
# (0, 0, 255, 255)
# 0x0000ffff
# (255, 0, 0)
# (0, 255, 0, 255)
# 0xff0000
# (255, 240, 0, 255)
# 0xfff000ff
# (0, 0, 255)
# (0, 255, 255)
# (223, 192, 203)
# #FF8811
# 0xff8811
# (223, 192, 203)
# #200000
# (223, 192, 203)
# #FFC0CB
# (203, 192, 223)
# 0xcbc0df
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fabisschomagut-0.10.tar.gz
(7.5 kB
view details)
Built Distribution
File details
Details for the file fabisschomagut-0.10.tar.gz
.
File metadata
- Download URL: fabisschomagut-0.10.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fee40c0e2add47e447c17f6007db9ee314585fcd6026a9e519367f9a63f86eb |
|
MD5 | c3d1ebffa2435bceb969e53a8dc3174d |
|
BLAKE2b-256 | 458e11a14b506ad38f7378a3d8896f726ee7c6fb2a7696b48ec3951ded2c37e1 |
Provenance
File details
Details for the file fabisschomagut-0.10-py3-none-any.whl
.
File metadata
- Download URL: fabisschomagut-0.10-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 953e2e939fe8daed47d8ada7c4e76cc8ac6b0452d2b8dd312b761700a9ac0287 |
|
MD5 | 0adc542c111b26ac2b6a662c430aa5f1 |
|
BLAKE2b-256 | 190cfb122d236ba5fafd45ee248f98f330dad7e076c0feb14021ec62e6217c86 |