Add support for RGBW and custom color layouts.#33
Open
Nashenas88 wants to merge 1 commit intorp-rs:mainfrom
Open
Add support for RGBW and custom color layouts.#33Nashenas88 wants to merge 1 commit intorp-rs:mainfrom
Nashenas88 wants to merge 1 commit intorp-rs:mainfrom
Conversation
Adds direct support for RGBW color via smart_leds::RGBA8, and allows clients to implement custom support via new ColorFormat trait.
9names
requested changes
Dec 20, 2024
| } | ||
| } | ||
|
|
||
| impl ColorFormat for smart_leds_trait::RGBA<u8> { |
Member
There was a problem hiding this comment.
No other smart_leds implementation uses RGBA8 to represent an RGBW LED array.
Did you look at other implementations before choosing this abstraction?
| /// let pins = rp2040_hal::gpio::pin::bank0::Pins::new(...); | ||
| /// | ||
| /// let (mut pio, sm0, _, _, _) = pac.PIO0.split(&mut pac.RESETS); | ||
| /// let mut ws = Ws2812Direct::<_, _, _, smart_leds::RGBA8>::new( |
Member
There was a problem hiding this comment.
Can you use multiple constructors (one for ws2812, one for sk6812rgbw) instead of requiring users to spell out the generics, please?
This is definitely a step backwards in terms of ergonomics for this API.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds direct support for RGBW color via smart_leds::RGBA8, and allows clients to implement custom support via new ColorFormat trait.