15 lines
306 B
Rust
15 lines
306 B
Rust
#[derive(Clone)]
|
|
pub struct RGB {
|
|
pub red: u8,
|
|
pub green: u8,
|
|
pub blue: u8
|
|
}
|
|
|
|
impl IntoIterator for RGB {
|
|
type Item = u8;
|
|
type IntoIter = std::array::IntoIter<u8, 3>;
|
|
|
|
fn into_iter(self) -> Self::IntoIter {
|
|
IntoIterator::into_iter([self.red, self.green, self.blue])
|
|
}
|
|
}
|