Skip to content

Add support for RGBW and custom color layouts.#33

Open
Nashenas88 wants to merge 1 commit intorp-rs:mainfrom
Nashenas88:rgbw
Open

Add support for RGBW and custom color layouts.#33
Nashenas88 wants to merge 1 commit intorp-rs:mainfrom
Nashenas88:rgbw

Conversation

@Nashenas88
Copy link
Copy Markdown

Adds direct support for RGBW color via smart_leds::RGBA8, and allows clients to implement custom support via new ColorFormat trait.

Adds direct support for RGBW color via smart_leds::RGBA8, and
allows clients to implement custom support via new ColorFormat trait.
Comment thread src/lib.rs
}
}

impl ColorFormat for smart_leds_trait::RGBA<u8> {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No other smart_leds implementation uses RGBA8 to represent an RGBW LED array.
Did you look at other implementations before choosing this abstraction?

Comment thread src/lib.rs
/// 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(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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.

2 participants