Skip to main content

Introduction

Documentation Status Discord Build Status Code Style: Black

Tools for generating color gradient palettes and sha

Dependencies

This driver depends on:

Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle or individual libraries can be installed using circup.Installing from PyPI =====================

On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally from PyPI. To install for current user:

pip3 install Foamyguy-circuitpython-gradienthelper

To install system-wide (this may be required in some cases):

sudo pip3 install Foamyguy-circuitpython-gradienthelper

To install in a virtual environment in your current project:

mkdir project-name && cd project-name
python3 -m venv .venv
source .env/bin/activate
pip3 install Foamyguy-circuitpython-gradienthelper

Installing to a Connected CircuitPython Device with Circup

Make sure that you have circup installed in your Python environment. Install it with the following command if necessary:

pip3 install circup

With circup installed and your CircuitPython device connected use the following command to install:

circup install gradienthelper

Or the following command to update an existing version:

circup update

Usage Example

from foamyguy_gradienthelper import (
    linear_gradient,
    polylinear_gradient,
    bezier_gradient,
)

def print_palette(palette):
    out_str = "["
    for color in palette:
        out_str = f"{out_str}{color:#0{8}x}, "
    out_str = out_str[:-2]
    out_str = f"{out_str}]"
    print(out_str)

linear_colors = linear_gradient(0xFF0000, 0x0000FF, 10)
print_palette(linear_colors)

polylinear_colors = polylinear_gradient((0x00FF00, 0xFFFF00, 0x00FFFF), 30)
print_palette(polylinear_colors)

bezier_colors = bezier_gradient((0xFF00FF, 0x00FFFF, 0x00FF00), 100)
print_palette(bezier_colors)

Documentation

API documentation for this library can be found on Read the Docs.

For information on building library documentation, please check out this guide.

Contributing

Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.

Metadata

Release files for foamyguy-circuitpython-gradienthelper 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for foamyguy-circuitpython-gradienthelper 1.0.0
File Size Uploaded
foamyguy-circuitpython-gradienthelper-1.0.0.tar.gz 29.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for foamyguy-circuitpython-gradienthelper 1.0.0
File Interpreter ABI Platform
foamyguy_circuitpython_gradienthelper-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 34.7 kB

Release files / foamyguy-circuitpython-gradienthelper-1.0.0.tar.gz

Download URL foamyguy-circuitpython-gradienthelper-1.0.0.tar.gz
Size 29.0 kB
Tags Source
SHA-256 checksum
How to use checksums
461e602a6a195dae8da9e46707a4cef5f28d4004d6fb3acb7743c7e54d8581a9
BLAKE2b-256 checksum
How to use checksums
54f859c626caf47ba43caca8dd1f5ceca7dc6c502364ef65355121776b870823
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release files / foamyguy_circuitpython_gradienthelper-1.0.0-py3-none-any.whl

Download URL foamyguy_circuitpython_gradienthelper-1.0.0-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
83364e15edb12640f56c6f77e46e36639ee87f3c75c73eeb121e6176c9ad13a0
BLAKE2b-256 checksum
How to use checksums
ccf9f9e5b721ebb87572d0d5807234d6b2df28be5db4aa7c59ffbcf62a123f06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page