usyd_colors
A Python version of the University of Sydney's brand color palettes. Inspired by the wonderful package for R: https://github.com/Sydney-Informatics-Hub/usydColours/tree/master
Installation
pip install usyd-colors
or
poetry add usyd-colors
Usage
1. Get a palette
from usyd_colors import get_palette
# Get the "primary" palette
primary_palette = get_palette("primary")
# Access and print the HEX colors
hex_colors = primary_palette.hex_colors()
print("HEX Colors in Primary Palette:", hex_colors)
# Access and print the RGB colors
rgb_colors = primary_palette.rgb_colors()
print("RGB Colors in Primary Palette:", rgb_colors)
outputs:
HEX Colors in Primary Palette: ['#424242', '#E64626', '#0148A4', '#FFB800', '#F1F1F1']
RGB Colors in Primary Palette: [(0.25882352941176473, 0.25882352941176473, 0.25882352941176473), (0.9019607843137255, 0.27450980392156865, 0.14901960784313725), (0.00392156862745098, 0.2823529411764706, 0.6431372549019608), (1.0, 0.7215686274509804, 0.0), (0.9450980392156862, 0.9450980392156862, 0.9450980392156862)]
2. Use with matplotlib
import numpy as np
import matplotlib.pyplot as plt
from usyd_colors import get_palette
# Get the "primary" palette
primary_palette = get_palette('primary')
# Generate some random data for a heatmap
data = np.random.rand(10, 10)
# Use the palette to create a Matplotlib colormap
colormap = primary_palette.matplotlib_colormap()
# Plot the heatmap using the colormap
plt.figure(figsize=(6, 6))
plt.imshow(data, cmap=colormap)
plt.colorbar()
plt.title('Heatmap with USYD Primary Palette Colormap', fontsize=16)
plt.show()
License
This project is licensed under the MIT License. See the LICENSE file for more details.
Metadata
Release files for usyd-colors 0.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 | Actions |
|---|---|---|---|---|
| usyd_colors-0.1.0.tar.gz | 3.0 kB | Without provenance | Details for usyd_colors-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| usyd_colors-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for usyd_colors-0.1.0-py3-none-any.whl |
Total release size: 7.0 kB
Release files / usyd_colors-0.1.0.tar.gz
| Download URL | usyd_colors-0.1.0.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
106e77c37441fdf2f7e455b1c2645fb0f09b26912a0acef3012a66e4517c5646
|
|
BLAKE2b-256 checksum How to use checksums |
0afaa3d4525f93d6a5d1c5fa5c8daeda4d276d1794841c613a1b781711474e81
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.10.12 Linux/5.15.153.1-microsoft-standard-WSL2
|
Release files / usyd_colors-0.1.0-py3-none-any.whl
| Download URL | usyd_colors-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5e0af1c845f3d2316ac56b6b48003a1335aa6f46f04e644744cfde7c1340af09
|
|
BLAKE2b-256 checksum How to use checksums |
bb147a6c7cd4cca7cd9c27b67a40acfdfb3dde0be4b27c21ce94fead6ed0f566
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.10.12 Linux/5.15.153.1-microsoft-standard-WSL2
|
Security for usyd-colors 0.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.