Struct helios_dac::Color
source · Fields§
§r: u8
Red channel
g: u8
Green channel
b: u8
Blue channel
Implementations§
source§impl Color
impl Color
sourcepub fn new(r: u8, g: u8, b: u8) -> Self
pub fn new(r: u8, g: u8, b: u8) -> Self
Examples found in repository?
examples/frames.rs (line 45)
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
fn get_frames() -> Vec<Frame> {
let mut frames = vec![];
let color = Color::new(0xD0, 0xFF, 0xD0);
for i in 0..30 {
let mut points = vec![];
let mut y = (i * 0xFFF / 30) as u16;
for j in 0..1000 {
let x = if j < 500 {
j * 0xFFF / 500
}else {
0xFFF - ((j - 500) * 0xFFF / 500)
} as u16;
points.push(Point {
coordinate: (x, y).into(),
color,
intensity: 0xFF
});
}
frames.push(Frame::new(30000, points));
}
frames
}