mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-29 17:34:58 +03:00
adjust rendering of parked cars
This commit is contained in:
parent
dfa1b82c70
commit
892e0592e1
@ -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();
|
||||
|
@ -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),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user