Skip to main content

A package containing various palettes inspired by the colors of The University of Sydney.

Project description

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.

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

usyd_colors-0.1.0.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

usyd_colors-0.1.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file usyd_colors-0.1.0.tar.gz.

File metadata

  • Download URL: usyd_colors-0.1.0.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.12 Linux/5.15.153.1-microsoft-standard-WSL2

File hashes

Hashes for usyd_colors-0.1.0.tar.gz
Algorithm Hash digest
SHA256 106e77c37441fdf2f7e455b1c2645fb0f09b26912a0acef3012a66e4517c5646
MD5 a20684204a021a769a33b28a393ae90a
BLAKE2b-256 0afaa3d4525f93d6a5d1c5fa5c8daeda4d276d1794841c613a1b781711474e81

See more details on using hashes here.

File details

Details for the file usyd_colors-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: usyd_colors-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.12 Linux/5.15.153.1-microsoft-standard-WSL2

File hashes

Hashes for usyd_colors-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5e0af1c845f3d2316ac56b6b48003a1335aa6f46f04e644744cfde7c1340af09
MD5 ca228651e9096d69564439130ce24757
BLAKE2b-256 bb147a6c7cd4cca7cd9c27b67a40acfdfb3dde0be4b27c21ce94fead6ed0f566

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page