adafruit / Adafruit_CircuitPython_NeoPixel

CircuitPython drivers for neopixels.
MIT License
308 stars 99 forks source link

Add class variables for basic colors #20

Closed Sigafoos closed 6 years ago

Sigafoos commented 6 years ago

I think it would be useful to have simple colors included as class variables. ie neopixel.Red or neopixel.Color.Red would be defined as (0x10, 0, 0)

tannewt commented 6 years ago

@Sigafoos want to make a PR for this? Maybe it'd fit better in a different library so it could be used with other pixels like DotStars. Is there a Python lib we could copy?

kattni commented 6 years ago

@tannewt and I had already discussed making a separate color/animations library. I agree this would be better as a separate library - less overhead when not being used, more opportunity for use with other libs. It was suggested that I add @PaintYourDragon to this conversation as well.

I think it would be great to start with just a color lib if you weren't interested in the animation concept, and then the lib is there if we want to add animations at a later time.

If you were interested, the idea came up when discussing having the basic animations available in MakeCode setup in a library to be available for people coming from MakeCode to CircuitPython. They're called things like "running" and "theatre chase", it's easy to get an idea what they do by looking at MakeCode (there's a simulation available). As well you could add anything else you like, those were meant to be a starting point. Like I said though, this is a lot more involved than creating color variables, so it's still excellent to start with a color-only lib.

margaret commented 6 years ago

I am going to take a stab at this (pycon sprints).

margaret commented 6 years ago

Nvm, @apatt did this already

apatt commented 6 years ago

I created the the library named led_animation and inside of that is color which has a list of named colors

https://github.com/apatt/led_animation

apatt commented 6 years ago

@tannewt this is ready to be closed

tannewt commented 6 years ago

Done in https://github.com/adafruit/Adafruit_CircuitPython_LED_Animation