Define your Python plot style
Project description
My Palette
This package has been create to fast-load color palettes for Python matplotlib library, and to convert txt files downloaded from https://coolors.co to generate and save new color palettes.
Table of contents
Installation
pip install --extra-index-url https://test.pypi.org/simple/ mypalette
Usage
Go to https://coolors.co and click "Start the generator" or use this set of colors on the top right corner press click on Export, Code, Download
This will save a file 'palette.txt' on you computer.
Examples
Create a new palette from existing txt file:
from mypalette import LoadPalette
palette = LoadPalette()
p = palette.create_new_palette(input_txt='palette_1.txt', output_json='palette_1.json')
print(p)
{'HEXs': ['#000000', '#FFFFFF'], 'RGBs': [(0.0, 0.0, 0.0), (1.0, 1.0, 1.0)], 'Names': ['black', 'white']}
Load a compatible JSON file:
p = palette.load_palette(json_path='palette_1.json')
print(p)
['#000000', '#FFFFFF']
Create a compatible JSON file from list of hexadecimal codes:
p = palette.create_palette_from_hex_list(
hexadecimal = ['#000000', '#FFFFFF'],
output_json = 'black_and_white.json')
print(p)
{'HEXs': ['#000000', '#FFFFFF'], 'RGBs': [(0.0, 0.0, 0.0), (1.0, 1.0, 1.0)], 'Names': ['black', 'white']}
Development and Contribute
I really welcome contributors (of all experience levels) to improve this package and expand its scope and reach.
If you have never worked on open source project before or you want to brush up your memory here, check out these links:
License
Copyright (c) 2020 Mattia Cinelli
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file mypalette-1.0.0.7.tar.gz
.
File metadata
- Download URL: mypalette-1.0.0.7.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a114919544330b1a4f7c4aa9ab96c26eee421439f0c154a9c5242927fef55e36 |
|
MD5 | cbd991edcdf0134ce7d0f34099a142e6 |
|
BLAKE2b-256 | 2eb41fcf3027704e1004b2dafc47c1f453268b9f1ecb8ae29f162b2781e6d3ba |
File details
Details for the file mypalette-1.0.0.7-py3-none-any.whl
.
File metadata
- Download URL: mypalette-1.0.0.7-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a214c95f8bd4b08c01c58bb00f592fe0516e5b0db969bdb50fc9e2b33bee349e |
|
MD5 | f41e596365c204705f9b049f9eb80fc4 |
|
BLAKE2b-256 | 59c21a5ca9116f294200514c1ab01334c01881f36994053bd08523f706ec2820 |