Python package for snaping/rounding colors to other colors/palettes.
Colorsnap comes with predefined palettes for CSS 2-4 and can also take custom ones defined by you as input and then snap/round a specified color to the closes one in the given palette.
## Installing
```python
pip install colorsnap
```
# Usage Examples
```python
import colorsnap
'''
Available palettes:
- CSS_2
- CSS_2_1
- CSS_3
- CSS_4
'''
colorsnap.snap_color(colorsnap.palettes.CSS_3, '#0000ba')
# >>> ('#0000ba', 'mediumblue')
# Using a custom palette
palette = {
'black': '#000000',
'gray': '#808080',
'white': '#ffffff',
}
colorsnap.snap_color(palette, '#0000ba')
# Using a custom palette with unnamed colors
palette = ['#4286f4', '#414449']
color_snap.snap_color(palette, '#5588db')
# >>> ('#5588db', '#4286f4')
```
Metadata
Release files for colorsnap 1.1.0
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 | |
|---|---|---|---|---|
| colorsnap-1.1.0.tar.gz | 3.7 kB | Without provenance | Details |
Release files / colorsnap-1.1.0.tar.gz
| Download URL | colorsnap-1.1.0.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
77ad4de95e6bc67a10239a8665a58bdf84815cc83ae6d44a289599d74ec5b29c
|
|
BLAKE2b-256 checksum How to use checksums |
11ff2b4bb990bbb1bbe022fc756ed0676c4975b7113f6319324a52f9695a013c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Python-urllib/3.6
|
Security for colorsnap 1.1.0
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.