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

Add support for RGBW and custom color layouts. #33

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Nashenas88
Copy link

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.
}
}

impl ColorFormat for smart_leds_trait::RGBA<u8> {
Copy link
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?

/// 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
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