mirror of
https://github.com/a-b-street/abstreet.git
synced 2025-01-02 03:18:55 +03:00
per suggestion of a cugos member, color all parked cars the same. distinguishing moving cars is helpful, but not parked ones
This commit is contained in:
parent
82ba62df29
commit
d2c674eb9a
@ -75,14 +75,6 @@ impl Color {
|
||||
Color::rgba_f(self.r, self.g, self.b, a)
|
||||
}
|
||||
|
||||
pub fn fade(&self, factor: f32) -> Color {
|
||||
let mut c = self.clone();
|
||||
c.r /= factor;
|
||||
c.g /= factor;
|
||||
c.b /= factor;
|
||||
c
|
||||
}
|
||||
|
||||
pub fn hex(raw: &str) -> Color {
|
||||
// Skip the leading '#'
|
||||
let r = usize::from_str_radix(&raw[1..3], 16).unwrap();
|
||||
|
@ -106,6 +106,7 @@ pub struct ColorScheme {
|
||||
pub ped_preparing_bike_body: Color,
|
||||
pub ped_crowd: Color,
|
||||
pub bike_frame: Color,
|
||||
pub parked_car: Color,
|
||||
|
||||
// Layers
|
||||
pub good_to_bad_red: ColorScale,
|
||||
@ -209,6 +210,7 @@ impl ColorScheme {
|
||||
ped_preparing_bike_body: Color::rgb(255, 0, 144),
|
||||
ped_crowd: Color::rgb_f(0.2, 0.7, 0.7),
|
||||
bike_frame: Color::hex("#AAA9AD"),
|
||||
parked_car: Color::hex("#938E85"),
|
||||
|
||||
// Layers
|
||||
good_to_bad_red: ColorScale(vec![hex("#F19A93"), hex("#A32015")]),
|
||||
|
@ -196,7 +196,7 @@ fn zoomed_color_car(input: &DrawCarInput, cs: &ColorScheme) -> Color {
|
||||
} else {
|
||||
match input.status {
|
||||
CarStatus::Moving => cs.rotating_color_agents(input.id.0),
|
||||
CarStatus::Parked => cs.rotating_color_agents(input.id.0).fade(1.5),
|
||||
CarStatus::Parked => cs.parked_car,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user