Make back strip match front strip

This commit is contained in:
Tangent Wantwight 2021-12-02 21:27:45 -05:00
parent 200d5a5594
commit c578960321

View file

@ -2,16 +2,12 @@ use super::delay;
use core::iter::repeat; use core::iter::repeat;
use house::Harrogate; use house::Harrogate;
use lights::{HardwareRgb, Lights, murmurf}; use lights::{HardwareRgb, Lights, murmurf};
use lights::rgb::{linear_gradient, Rgb}; use lights::rgb::Rgb;
const BG: Rgb = Rgb(255, 0, 255);
const DOOR: Rgb = Rgb(255, 255, 255);
const YELLOW: Rgb = Rgb(200, 200, 0); const YELLOW: Rgb = Rgb(200, 200, 0);
const RED: Rgb = Rgb(200, 0, 0); const RED: Rgb = Rgb(200, 0, 0);
const GREEN: Rgb = Rgb(0, 200, 0); const GREEN: Rgb = Rgb(0, 200, 0);
const BLUE: Rgb = Rgb(0, 0, 200); const BLUE: Rgb = Rgb(0, 0, 200);
//const PURPLE: Rgb = Rgb(160, 0, 128);
/* /*
* 20 fade + 25 ON + 20 fade = 65 dots * 20 fade + 25 ON + 20 fade = 65 dots
@ -21,10 +17,6 @@ const BLUE: Rgb = Rgb(0, 0, 200);
#[allow(dead_code)] #[allow(dead_code)]
#[inline(always)] #[inline(always)]
pub fn run(lights: &mut impl Lights<Pixel = HardwareRgb>) -> ! { pub fn run(lights: &mut impl Lights<Pixel = HardwareRgb>) -> ! {
let door_highlight = linear_gradient(BG, DOOR, 20)
.chain(repeat(DOOR).take(25))
.chain(linear_gradient(DOOR, BG, 20));
let mut rng: u32 = 0xF07; let mut rng: u32 = 0xF07;
loop { loop {
@ -38,7 +30,7 @@ pub fn run(lights: &mut impl Lights<Pixel = HardwareRgb>) -> ! {
} }
Harrogate { Harrogate {
porch_back: repeat(BG).take(85).chain(door_highlight.clone()), porch_back: colors.into_iter().flat_map(|color| repeat(color).take(19)),
porch_front: colors.into_iter().flat_map(|color| repeat(color).take(19)), porch_front: colors.into_iter().flat_map(|color| repeat(color).take(19)),
}.render_to(lights); }.render_to(lights);