a small, multi-use color library for python that supports RGB, Hexadecimal, Decimal, CMYK and most web colors
Project description
pyspectrum
a small, multi-use color library for python
supports RGB, Hexadecimal, Decimal, CMYK and most web colors (red, seagreen, yellow)
Quickstart
Installation & Upgrading
Using pip to install is highly reccomended
pip install -U pyspectrum
Upgrade to the latest stable version
pip install -U --upgrade pyspectrum
Example
import pyspectrum
# init colors
c = pyspectrum.Colors()
# creating color classes out of values
redRGB = c.RGB(255, 0, 0)
redHex = c.Hexadecimal("#ff0000")
redCMYK = c.CMYK(0, 100, 100, 0)
# html/css color name
convertedRGB = c.from_name("red")
# converting values
convertedCMYK = redRGB.to_cmyk()
convertedHex = redRGB.to_hex()
# accessing tuples and printing
print(f"Red RGB tuple: {redRGB.to_tuple()}")
print(f"Red Hex code: {redHex.to_string()}")
print(f"Red CMYK tuple: {redCMYK.to_tuple()}")
## printing colored text from RGB
# prints'This is red text' in a red color
print(c.color_text("This is red text", redRGB))
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
pyspectrum-0.1.1.tar.gz
(6.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyspectrum-0.1.1.tar.gz.
File metadata
- Download URL: pyspectrum-0.1.1.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.5.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94420c719a3929b572cb502afc9c9eae48fdba4057421d0149cdfc1589451856
|
|
| MD5 |
f53604aeaca1f988432e87fdb22eda1a
|
|
| BLAKE2b-256 |
f393f01c0c99e11c3ae11a3f22e1ff6bca8ab9c5a8393916b046d8043703c573
|
File details
Details for the file pyspectrum-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pyspectrum-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.5.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9daab70f3009bb5b9dc04ab98c9d9631f11068d467cf66e04d1a9403bb919b1b
|
|
| MD5 |
65270f13ae88546146fd575e2cdad893
|
|
| BLAKE2b-256 |
7778469d2bb5d27ba147b0cac02ff8ae673a84326c7275266d26ac2e206dd2f7
|