pimoroni / blinkt

Python Library for Blinkt; 8 APA102 LEDs for your Raspberry Pi
https://shop.pimoroni.com/products/blinkt
MIT License
314 stars 103 forks source link

add eyedropper example #90

Closed HerbFargus closed 3 years ago

HerbFargus commented 3 years ago

This is just a quick example to create a real-time eyedropper where the LEDs on the blinkt reflect the rgb value at the mouse cursor. I'm sure it could be optimised but thought I'd put it out there for anyone interested.

quick video in action:

eyedropper

Dependencies:

pillow and pyautogui depend on x to work, so won't work directly on the framebuffer eg doesn't work on retropie.

Tested and working on my Raspberry Pi 4 on the latest Buster Desktop Raspberry Pi OS (2021-01-11)

druck-pexip commented 3 years ago

Nice. If you could separate the blinkt LEDs and evenly space them around the back of the screen, you could do a DIY Philips ambilight™

HerbFargus commented 3 years ago

Nice. If you could separate the blinkt LEDs and evenly space them around the back of the screen, you could do a DIY Philips ambilightâ„¢

This is actually a derivative result of my attempts to do just that, but since as far as I can tell the blinkt module isn't directly supported with hyperion, I cobbled together something like this but the code isn't really up to snuff for inclusion in this repo.

Gadgetoid commented 3 years ago

Aaaagh lured into thinking that GitHub's "Update Branch" feature would actually do something sensible. Grumble.

Hopefully the tests should actually run now. This example looks ace- cool trick!

coveralls commented 3 years ago

Pull Request Test Coverage Report for Build 799118883


Totals Coverage Status
Change from base Build 799118446: 0.0%
Covered Lines: 57
Relevant Lines: 77

💛 - Coveralls
Gadgetoid commented 3 years ago

Thank you- I can't actually locate a Blinkt! to try this out with, but it runs-

May be worth noting somewhere that a very up-to-date version of PIL/Pillow is required. I had to python3 -m pip install pillow --upgrade to replace the python3-pip apt version.