Skip to content

Commit ee43509

Browse files
authored
Merge pull request #2 from smart-leds-rs/rgb
Use RGB8 type from rgb crate
2 parents 7772c5c + 9a858ba commit ee43509

File tree

2 files changed

+3
-16
lines changed

2 files changed

+3
-16
lines changed

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "smart-leds-trait"
3-
version = "0.1.0"
3+
version = "0.1.1"
44
authors = ["David Sawatzke <[email protected]>"]
55
edition = "2018"
66
categories = [
@@ -15,3 +15,4 @@ repository = "https://github.com/smart-leds-rs/smart-leds-trait"
1515

1616

1717
[dependencies]
18+
rgb = "0.8"

src/lib.rs

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,7 @@
11
#![no_std]
22

3-
#[derive(Copy, Clone, Default)]
4-
pub struct Color {
5-
pub r: u8,
6-
pub g: u8,
7-
pub b: u8,
8-
}
3+
pub type Color = rgb::RGB8;
94

10-
impl From<(u8, u8, u8)> for Color {
11-
fn from(color_tuple: (u8, u8, u8)) -> Self {
12-
Self {
13-
r: color_tuple.0,
14-
g: color_tuple.1,
15-
b: color_tuple.2,
16-
}
17-
}
18-
}
195
pub trait SmartLedsWrite {
206
type Error;
217
fn write<T>(&mut self, iterator: T) -> Result<(), Self::Error>

0 commit comments

Comments
 (0)