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
- remove different colors for changed intersections
- tune traffic light colors
- draw stop signs as rounded ellipse (hard without using rotations in GfxCtx)

View File

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

View File

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

View File

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