mycolorpy
A scientific visualization toolkit for generating dynamic color arrays from any colormap. Contains functions to create an array of colors based on a colormap.
Installation Instructions:
You can pip install it using:
pip install mycolorpy
You can then do:
from mycolorpy import colorlist as mcp
Example: To create a list of 5 hex strings from cmap "winter"
color1=mcp.gen_color(cmap="winter",n=5)
print(color1)
Output:
['#0000ff', '#0040df', '#0080bf', '#00c09f', '#00ff80']
Another example to generate 16 list of colors from cmap bwr:
color2=mcp.gen_color(cmap="bwr",n=16)
print(color2)
Output:
['#0000ff', '#2222ff', '#4444ff', '#6666ff', '#8888ff', '#aaaaff', '#ccccff', '#eeeeff', '#ffeeee', '#ffcccc', '#ffaaaa', '#ff8888', '#ff6666', '#ff4444', '#ff2222', '#ff0000']
There is a python notebook with usage examples to better visualize this.
Say you want to generate a list of colors from a cmap that is normalized to a given data. You can do that using:
a=random.randint(1000, size=(200))
a=np.array(a)
color1=mcp.gen_color_normalized(cmap="seismic",data_arr=a)
plt.scatter(a,a,c=color1)
You can also reverse the color using:
color1=mcp.gen_color_normalized(cmap="seismic",data_arr=a,reverse=True)
plt.scatter(a,a,c=color1)
Release files for mycolorpy 1.5.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mycolorpy-1.5.3.tar.gz | 4.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mycolorpy-1.5.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.9 kB
Release files / mycolorpy-1.5.3.tar.gz
| Download URL | mycolorpy-1.5.3.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
38668f8bc1d4abfa8dca214434550c2289a968ceb067929e8637e393e6dc2c36
|
|
BLAKE2b-256 checksum How to use checksums |
0b9e2d6a1bc1a52f9c17c34a51cee40c23f338c5ba6c7ea9dee3c3f83a97a0e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Release files / mycolorpy-1.5.3-py3-none-any.whl
| Download URL | mycolorpy-1.5.3-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fd3153c6348b0e6251142c818e67c94f5f9316ef8586236ebb9caac17f469540
|
|
BLAKE2b-256 checksum How to use checksums |
0ffac8207f74ddbd73c28b569cabdd3c7f5315715f72908c2ef02c5cc660f7d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|