Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added __getitem__ for iterable behavior #5

Merged
merged 3 commits into from
Mar 18, 2019

Conversation

s-light
Copy link
Contributor

@s-light s-light commented Nov 24, 2018

i added getitem and len magic functions to the CRGB and CHSV classes.
this way the get iterable and you can access the color-parts in list style.
so for other classes its easier to access the content in the same form as a plain list or tuple.

let me know what you think of this.

this idea came to my mind as i implemented the TLC5957 driver

adafruit_fancyled/adafruit_fancyled.py Outdated Show resolved Hide resolved
adafruit_fancyled/adafruit_fancyled.py Outdated Show resolved Hide resolved
@jrowe88
Copy link

jrowe88 commented Mar 16, 2019

Thanks @kattni ! len makes it play nicer with dotstar library. Is someone going to merge this in?

@PaintYourDragon
Copy link
Contributor

Looks good, OK to merge.

@kattni kattni merged commit 37c7898 into adafruit:master Mar 18, 2019
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Mar 18, 2019
Updating https://github.com/adafruit/Adafruit_CircuitPython_FancyLED to 1.3.0 from 1.2.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_FancyLED#5 from s-light/add_getitem

Updating https://github.com/adafruit/Adafruit_CircuitPython_Logger to 1.1.0 from 1.0.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_Logging#4 from dastels/master
  > Merge pull request adafruit/Adafruit_CircuitPython_Logging#3 from dastels/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA:
  > Added the following libraries: Adafruit_CircuitPython_AdafruitIO, Adafruit_CircuitPython_Logger
@s-light s-light deleted the add_getitem branch March 19, 2019 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants