Color Shade Generator
Color Shade Generator is a Python package that allows you to easily generate a list of shades for a given color. The package can generate shades in both hexadecimal and RGB format.
Installation
You can install the package using pip:
pip install python-colorcode==0.1
Usage
The package provides a single function called generate_color_shades() which takes in two parameters:
color_name: the name of the color for which you want to generate shades. The color name should be a string that is recognized by the webcolors library.
rgb (optional): a boolean value that indicates whether the shades should be returned in RGB format (True) or hex format (False). The default value is False.
Here is an example of how to use the generate_color_shades() function:
from python-colorcode import python_colorcode
try:
hex_shades = python_colorcode.generate_color_shades("red")
print(hex_shades)
rgb_shades = python_colorcode.generate_color_shades("red", rgb=True)
print(rgb_shades)
except ValueError as e:
print(e)
The above code will generate 20 shades of the color red, in hex and RGB format, respectively. If the color name passed is not valid, it will raise a ValueError.
Note
This package is using webcolors library to convert color name to RGB, it supports all the CSS3 standard color names, you can find the full list here
Also, you can add more functionality like,
ability to return the shades in different format like HSL or HSV. ability to return the shades in the order of Lightest to Darkest or vice versa. etc.
Contributing
If you would like to contribute to the package, please submit a pull request.
License
This package is licensed under the MIT License.
Acknowledgements
This package is using webcolors library, you can find more information about it here
Metadata
Release files for python-colorcode 0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| python-colorcode-0.4.tar.gz | 2.8 kB | Without provenance | Details |
Release files / python-colorcode-0.4.tar.gz
| Download URL | python-colorcode-0.4.tar.gz |
|---|---|
| Size | 2.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
909770e4a33675f1d1557b4e41fc9964bba70ac6a6dce60828979368458b4636
|
|
BLAKE2b-256 checksum How to use checksums |
b6885fa3b0044b70b8c1757e910a070ed7024e7401762da62ba5bd412561adc6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.8
|
Security for python-colorcode 0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.