From 0bec946dce846fe7f5c5c56fed973a81171b0e24 Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Sat, 4 Apr 2020 18:28:30 -0700 Subject: [PATCH] resurrect another color scheme idea --- game/src/colors.rs | 20 +++++++++++++++++++- game/src/info/bus.rs | 2 +- game/src/info/intersection.rs | 4 ++-- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/game/src/colors.rs b/game/src/colors.rs index c70a286a75..964df8d50a 100644 --- a/game/src/colors.rs +++ b/game/src/colors.rs @@ -19,6 +19,7 @@ pub enum ColorSchemeChoice { SAMDesertDay, BAP, OSM, + Starcat, } impl ColorSchemeChoice { @@ -30,6 +31,7 @@ impl ColorSchemeChoice { Choice::new("sam desert day", ColorSchemeChoice::SAMDesertDay), Choice::new("bap", ColorSchemeChoice::BAP), Choice::new("osm", ColorSchemeChoice::OSM), + Choice::new("starcat", ColorSchemeChoice::Starcat), ] } } @@ -120,6 +122,7 @@ impl ColorScheme { ColorSchemeChoice::SAMDesertDay => ColorScheme::sam_desert_day(), ColorSchemeChoice::BAP => ColorScheme::bap(), 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( &vec![ Color::RED, @@ -303,4 +306,19 @@ impl ColorScheme { cs.road_center_line = Color::rgb(202, 177, 39); 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 + } } diff --git a/game/src/info/bus.rs b/game/src/info/bus.rs index 79aff481ab..e88bce1120 100644 --- a/game/src/info/bus.rs +++ b/game/src/info/bus.rs @@ -129,7 +129,7 @@ fn delays_over_time(ctx: &mut EventCtx, app: &App, id: BusRouteID) -> Widget { }; series.push(Series { 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 .remove(&route.stops[idx2]) .unwrap_or_else(Vec::new), diff --git a/game/src/info/intersection.rs b/game/src/info/intersection.rs index a3306d6be1..5448666ab1 100644 --- a/game/src/info/intersection.rs +++ b/game/src/info/intersection.rs @@ -119,7 +119,7 @@ fn delay_plot(ctx: &EventCtx, app: &App, i: IntersectionID, opts: &DataOptions) { all_series.push(Series { label: stat.to_string(), - color: app.cs.rotating_color_map(idx), + color: app.cs.rotating_color_plot(idx), pts, }); } @@ -130,7 +130,7 @@ fn delay_plot(ctx: &EventCtx, app: &App, i: IntersectionID, opts: &DataOptions) { all_series.push(Series { 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, }); }