cleaning up intersection colors

This commit is contained in:
Dustin Carlino 2018-07-04 13:27:04 -07:00
parent 92f8aeff1e
commit c58b91ee4d
4 changed files with 24 additions and 42 deletions

View File

@ -115,8 +115,6 @@ wait slow down even more -- before any of this change, lanes on adjacent roads s
- waiting on https://github.com/paholg/dimensioned/issues/31 to release - waiting on https://github.com/paholg/dimensioned/issues/31 to release
- remove different colors for changed intersections
- tune traffic light colors
- draw stop signs as rounded ellipse (hard without using rotations in GfxCtx) - draw stop signs as rounded ellipse (hard without using rotations in GfxCtx)

View File

@ -72,28 +72,16 @@
0.0, 0.0,
1.0 1.0
], ],
"ChangedStopSignIntersection": [ "UnchangedIntersection": [
0.0, 0.6,
1.0, 0.6,
0.0, 0.6,
1.0 1.0
], ],
"ChangedTrafficSignalIntersection": [ "ChangedIntersection": [
1.0, 0.8,
0.65, 0.6,
0.0, 0.6,
1.0
],
"TrafficSignalIntersection": [
1.0,
1.0,
0.0,
1.0
],
"NormalIntersection": [
0.3,
0.3,
0.3,
1.0 1.0
], ],
"Selected": [ "Selected": [
@ -247,9 +235,9 @@
1.0 1.0
], ],
"TrafficSignalBox": [ "TrafficSignalBox": [
0.8439573, 0.0,
0.49223435, 0.0,
0.26289922, 0.0,
1.0 1.0
], ],
"TrafficSignalGreen": [ "TrafficSignalGreen": [

View File

@ -22,10 +22,10 @@ pub enum Colors {
SidewalkMarking, SidewalkMarking,
Crosswalk, Crosswalk,
StopSignMarking, StopSignMarking,
ChangedStopSignIntersection,
ChangedTrafficSignalIntersection, UnchangedIntersection,
TrafficSignalIntersection, ChangedIntersection,
NormalIntersection,
Selected, Selected,
Turn, Turn,
ConflictingTurn, ConflictingTurn,

View File

@ -253,21 +253,17 @@ impl UI {
fn color_intersection(&self, id: map_model::IntersectionID) -> Color { fn color_intersection(&self, id: map_model::IntersectionID) -> Color {
let i = self.map.get_i(id); let i = self.map.get_i(id);
// TODO weird to squeeze in some quick logic here? let changed = if let Some(s) = self.control_map.traffic_signals.get(&i.id) {
let default_color = if let Some(s) = self.control_map.traffic_signals.get(&i.id) { s.changed()
if s.changed() {
self.cs.get(Colors::ChangedTrafficSignalIntersection)
} else {
self.cs.get(Colors::TrafficSignalIntersection)
}
} else if let Some(s) = self.control_map.stop_signs.get(&i.id) { } else if let Some(s) = self.control_map.stop_signs.get(&i.id) {
if s.changed() { s.changed()
self.cs.get(Colors::ChangedStopSignIntersection)
} else { } else {
self.cs.get(Colors::NormalIntersection) false
} };
let default_color = if changed {
self.cs.get(Colors::ChangedIntersection)
} else { } else {
self.cs.get(Colors::NormalIntersection) self.cs.get(Colors::UnchangedIntersection)
}; };
self.current_selection_state self.current_selection_state