very slightly reducing the number of colorscheme entries...

This commit is contained in:
Dustin Carlino 2019-11-09 14:50:42 -08:00
parent f299d38ea3
commit 32aa38d164
4 changed files with 13 additions and 14 deletions

View File

@ -202,12 +202,11 @@ impl State for TrafficSignalEditor {
let phase = &map.get_traffic_signal(self.diagram.i).phases[self.diagram.current_phase()];
for t in &ui.primary.draw_map.get_turns(self.diagram.i, map) {
let arrow_color = match phase.get_priority(t.id) {
TurnPriority::Protected => ui
.cs
.get_def("priority turn in current phase", Color::GREEN),
TurnPriority::Protected => ui.cs.get("turn protected by traffic signal"),
TurnPriority::Yield => ui
.cs
.get_def("yield turn in current phase", Color::rgb(255, 105, 180)),
.get("turn that can yield by traffic signal")
.alpha(1.0),
TurnPriority::Banned => ui.cs.get_def("turn not in current phase", Color::BLACK),
};
t.draw_icon(

View File

@ -313,7 +313,7 @@ fn make_crosswalk(batch: &mut GeomBatch, turn: &Turn, cs: &ColorScheme) {
// Reuse perp_line. Project away an arbitrary amount
let pt2 = pt1.project_away(Distance::meters(1.0), turn.angle());
batch.push(
cs.get_def("crosswalk", Color::WHITE),
cs.get("general road marking"),
perp_line(Line::new(pt1, pt2), LANE_THICKNESS)
.make_polygons(CROSSWALK_LINE_THICKNESS),
);
@ -322,7 +322,7 @@ fn make_crosswalk(batch: &mut GeomBatch, turn: &Turn, cs: &ColorScheme) {
let pt3 = line.dist_along(dist_along + 2.0 * CROSSWALK_LINE_THICKNESS);
let pt4 = pt3.project_away(Distance::meters(1.0), turn.angle());
batch.push(
cs.get("crosswalk"),
cs.get("general road marking"),
perp_line(Line::new(pt3, pt4), LANE_THICKNESS)
.make_polygons(CROSSWALK_LINE_THICKNESS),
);

View File

@ -67,17 +67,17 @@ impl DrawLane {
}
LaneType::Parking => {
draw.extend(
cs.get_def("parking lines", Color::WHITE),
cs.get_def("general road marking", Color::WHITE),
calculate_parking_lines(lane),
);
}
LaneType::Driving | LaneType::Bus => {
draw.extend(
cs.get_def("dashed lane line", Color::WHITE),
cs.get("general road marking"),
calculate_driving_lines(lane, road, timer),
);
draw.extend(
cs.get_def("turn restrictions on lane", Color::WHITE),
cs.get("general road marking"),
calculate_turn_markings(map, lane, timer),
);
}
@ -222,7 +222,7 @@ fn calculate_parking_lines(lane: &Lane) -> Vec<Polygon> {
}
fn calculate_driving_lines(lane: &Lane, parent: &Road, timer: &mut Timer) -> Vec<Polygon> {
// The leftmost lanes don't have dashed white lines.
// The leftmost lanes don't have dashed lines.
let (dir, idx) = parent.dir_and_offset(lane.id);
if idx == 0 || (dir && parent.children_forwards[idx - 1].1 == LaneType::SharedLeftTurn) {
return Vec::new();

View File

@ -19,11 +19,11 @@ pub fn draw_signal_phase(
return;
}
let priority_color = ctx
let protected_color = ctx
.cs
.get_def("turns protected by traffic signal right now", Color::GREEN);
.get_def("turn protected by traffic signal", Color::GREEN);
let yield_color = ctx.cs.get_def(
"turns allowed with yielding by traffic signal right now",
"turn that can yield by traffic signal",
Color::rgba(255, 105, 180, 0.8),
);
@ -36,7 +36,7 @@ pub fn draw_signal_phase(
for t in &phase.protected_turns {
let turn = ctx.map.get_t(*t);
if !turn.between_sidewalks() {
DrawTurn::full_geom(turn, batch, priority_color);
DrawTurn::full_geom(turn, batch, protected_color);
}
}
for t in &phase.yield_turns {