Python package for snaping/rounding colors to other colors/palettes.
Project description
Colorsnap
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
pip install colorsnap
Usage Examples
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')
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for colorsnap-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20c565508d1b84bf012493445f80f7aa52b1044a296def7089f74bcf9d181319 |
|
MD5 | 12d235f0cd91299b115c4aed0cfd5d60 |
|
BLAKE2b-256 | a34f9238ef99d01c5bba8707240932456141853798f560cb7176248694e626fb |