mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-25 22:13:27 +03:00
resurrect another color scheme idea
This commit is contained in:
parent
b62c293104
commit
0bec946dce
@ -19,6 +19,7 @@ pub enum ColorSchemeChoice {
|
|||||||
SAMDesertDay,
|
SAMDesertDay,
|
||||||
BAP,
|
BAP,
|
||||||
OSM,
|
OSM,
|
||||||
|
Starcat,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ColorSchemeChoice {
|
impl ColorSchemeChoice {
|
||||||
@ -30,6 +31,7 @@ impl ColorSchemeChoice {
|
|||||||
Choice::new("sam desert day", ColorSchemeChoice::SAMDesertDay),
|
Choice::new("sam desert day", ColorSchemeChoice::SAMDesertDay),
|
||||||
Choice::new("bap", ColorSchemeChoice::BAP),
|
Choice::new("bap", ColorSchemeChoice::BAP),
|
||||||
Choice::new("osm", ColorSchemeChoice::OSM),
|
Choice::new("osm", ColorSchemeChoice::OSM),
|
||||||
|
Choice::new("starcat", ColorSchemeChoice::Starcat),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -120,6 +122,7 @@ impl ColorScheme {
|
|||||||
ColorSchemeChoice::SAMDesertDay => ColorScheme::sam_desert_day(),
|
ColorSchemeChoice::SAMDesertDay => ColorScheme::sam_desert_day(),
|
||||||
ColorSchemeChoice::BAP => ColorScheme::bap(),
|
ColorSchemeChoice::BAP => ColorScheme::bap(),
|
||||||
ColorSchemeChoice::OSM => ColorScheme::osm(),
|
ColorSchemeChoice::OSM => ColorScheme::osm(),
|
||||||
|
ColorSchemeChoice::Starcat => ColorScheme::starcat(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -208,7 +211,7 @@ impl ColorScheme {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn rotating_color_map(&self, idx: usize) -> Color {
|
pub fn rotating_color_plot(&self, idx: usize) -> Color {
|
||||||
modulo_color(
|
modulo_color(
|
||||||
&vec![
|
&vec![
|
||||||
Color::RED,
|
Color::RED,
|
||||||
@ -303,4 +306,19 @@ impl ColorScheme {
|
|||||||
cs.road_center_line = Color::rgb(202, 177, 39);
|
cs.road_center_line = Color::rgb(202, 177, 39);
|
||||||
cs
|
cs
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn starcat() -> ColorScheme {
|
||||||
|
let mut cs = ColorScheme::standard();
|
||||||
|
cs.grass = hex("#3F8C0C");
|
||||||
|
cs.building = hex("#8099A8"); // #5E7486
|
||||||
|
cs.map_background = hex("#737373");
|
||||||
|
cs.driving_lane = hex("#2A2A2A"); // TODO for arterial
|
||||||
|
cs.road_center_line = hex("#DB952E");
|
||||||
|
cs.general_road_marking = hex("#D6D6D6");
|
||||||
|
cs.sidewalk = cs.general_road_marking;
|
||||||
|
cs.sidewalk_lines = hex("#707070");
|
||||||
|
cs.bike_lane = hex("#72CE36");
|
||||||
|
cs.bus_lane = hex("#AD302D");
|
||||||
|
cs
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -129,7 +129,7 @@ fn delays_over_time(ctx: &mut EventCtx, app: &App, id: BusRouteID) -> Widget {
|
|||||||
};
|
};
|
||||||
series.push(Series {
|
series.push(Series {
|
||||||
label: format!("Stop {}->{}", idx1 + 1, idx2 + 1),
|
label: format!("Stop {}->{}", idx1 + 1, idx2 + 1),
|
||||||
color: app.cs.rotating_color_map(idx1),
|
color: app.cs.rotating_color_plot(idx1),
|
||||||
pts: delays_per_stop
|
pts: delays_per_stop
|
||||||
.remove(&route.stops[idx2])
|
.remove(&route.stops[idx2])
|
||||||
.unwrap_or_else(Vec::new),
|
.unwrap_or_else(Vec::new),
|
||||||
|
@ -119,7 +119,7 @@ fn delay_plot(ctx: &EventCtx, app: &App, i: IntersectionID, opts: &DataOptions)
|
|||||||
{
|
{
|
||||||
all_series.push(Series {
|
all_series.push(Series {
|
||||||
label: stat.to_string(),
|
label: stat.to_string(),
|
||||||
color: app.cs.rotating_color_map(idx),
|
color: app.cs.rotating_color_plot(idx),
|
||||||
pts,
|
pts,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -130,7 +130,7 @@ fn delay_plot(ctx: &EventCtx, app: &App, i: IntersectionID, opts: &DataOptions)
|
|||||||
{
|
{
|
||||||
all_series.push(Series {
|
all_series.push(Series {
|
||||||
label: format!("{} (baseline)", stat),
|
label: format!("{} (baseline)", stat),
|
||||||
color: app.cs.rotating_color_map(idx).alpha(0.3),
|
color: app.cs.rotating_color_plot(idx).alpha(0.3),
|
||||||
pts,
|
pts,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user