adjust rendering of parked cars

This commit is contained in:
Dustin Carlino 2019-12-17 15:55:47 -08:00
parent dfa1b82c70
commit 892e0592e1
2 changed files with 8 additions and 1 deletions

View File

@ -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();

View File

@ -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),
}
}
}