-
Notifications
You must be signed in to change notification settings - Fork 441
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
Make colors iterable and indexable #2415
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2415 +/- ##
=======================================
Coverage 93.63% 93.64%
=======================================
Files 74 74
Lines 15984 15994 +10
=======================================
+ Hits 14967 14977 +10
Misses 1017 1017 |
Ah, and codecov has a point: we also need tests. |
Amazing when your CI helps you! |
I've pushed some changes (it was easier than adding them as suggestions). Please review and check if you agree. I think coverage should still be OK but I haven't checked, will have to look at CI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving with a single remark. Not sure about downstream code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
* Quick implementation * Apply code review suggestions, support string indexing, add tests * Apply suggestions from code review * Update channel names and __getitem__ * Add tests * Support negative indices and slices Co-authored-by: Andras Deak <deak.andris@gmail.com>
Overview
Support for
pyvista.Color()[i]
andfor c in pyvista.Color()
to make it backwards compatible with the old 'float tuple' representation.Fixes #2409.
Details
The
float_rgba
representation is used for indexing and iteration.