diff --git a/ezgui/src/color.rs b/ezgui/src/color.rs index 47c17190dd..1c864c8dca 100644 --- a/ezgui/src/color.rs +++ b/ezgui/src/color.rs @@ -94,6 +94,13 @@ impl Color { } } + pub fn fade(&self, factor: f32) -> Color { + match self { + Color::RGBA(r, g, b, a) => Color::RGBA(*r / factor, *g / factor, *b / factor, *a), + _ => unreachable!(), + } + } + pub fn hex(raw: &str) -> Color { // Skip the leading '#' let r = usize::from_str_radix(&raw[1..3], 16).unwrap(); diff --git a/game/src/render/car.rs b/game/src/render/car.rs index 828826ed14..434dda9d4d 100644 --- a/game/src/render/car.rs +++ b/game/src/render/car.rs @@ -164,7 +164,7 @@ fn zoomed_color_car(input: &DrawCarInput, cs: &ColorScheme) -> Color { } else { match input.status { CarStatus::Moving => rotating_color_agents(input.id.0), - CarStatus::Parked => cs.get_def("parked car", Color::rgb(180, 233, 76)), + CarStatus::Parked => rotating_color_agents(input.id.0).fade(1.5), } } }