Skip to main content

Tools for generating color gradient palettes and sha

Project description

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.

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 foamyguy-circuitpython-gradienthelper-1.0.0.tar.gz.

File metadata

File hashes

Hashes for foamyguy-circuitpython-gradienthelper-1.0.0.tar.gz
Algorithm Hash digest
SHA256 461e602a6a195dae8da9e46707a4cef5f28d4004d6fb3acb7743c7e54d8581a9
MD5 1f1bbd93964b830214e78b5cf1f51b3b
BLAKE2b-256 54f859c626caf47ba43caca8dd1f5ceca7dc6c502364ef65355121776b870823

See more details on using hashes here.

File details

Details for the file foamyguy_circuitpython_gradienthelper-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for foamyguy_circuitpython_gradienthelper-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 83364e15edb12640f56c6f77e46e36639ee87f3c75c73eeb121e6176c9ad13a0
MD5 bce040f91bdecc6ed62548de3fde12f3
BLAKE2b-256 ccf9f9e5b721ebb87572d0d5807234d6b2df28be5db4aa7c59ffbcf62a123f06

See more details on using hashes here.

Supported by

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