mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-25 11:44:25 +03:00
fix other crates that have Color constants
This commit is contained in:
parent
a61abca478
commit
37006369af
@ -27,7 +27,6 @@ extern crate rand;
|
||||
#[macro_use]
|
||||
extern crate serde_derive;
|
||||
extern crate sim;
|
||||
#[macro_use]
|
||||
extern crate structopt;
|
||||
|
||||
#[macro_use]
|
||||
|
@ -4,7 +4,6 @@ extern crate ezgui;
|
||||
extern crate geom;
|
||||
extern crate map_model;
|
||||
extern crate piston;
|
||||
#[macro_use]
|
||||
extern crate structopt;
|
||||
|
||||
mod render;
|
||||
|
@ -1,17 +1,17 @@
|
||||
use aabb_quadtree::geom::{Point, Rect};
|
||||
use aabb_quadtree::QuadTree;
|
||||
use ezgui::GfxCtx;
|
||||
use ezgui::{Color, GfxCtx};
|
||||
use geom::{Bounds, Line, LonLat, Polygon, Pt2D};
|
||||
use map_model::{Building, BuildingID, Map, Road, RoadID, LANE_THICKNESS};
|
||||
|
||||
// black
|
||||
const BACKGROUND: [f32; 4] = [0.0, 0.0, 0.0, 1.0];
|
||||
const BACKGROUND: Color = Color([0.0, 0.0, 0.0, 1.0]);
|
||||
// light orange
|
||||
const ROAD: [f32; 4] = [1.0, 154.0 / 255.0, 0.0, 1.0];
|
||||
const ROAD: Color = Color([1.0, 154.0 / 255.0, 0.0, 1.0]);
|
||||
// purple
|
||||
const BUILDING: [f32; 4] = [136.0 / 255.0, 30.0 / 255.0, 228.0 / 255.0, 1.0];
|
||||
const BUILDING: Color = Color([136.0 / 255.0, 30.0 / 255.0, 228.0 / 255.0, 1.0]);
|
||||
// dark orange / red
|
||||
const PATH: [f32; 4] = [247.0 / 255.0, 95.0 / 255.0, 28.0 / 255.0, 1.0];
|
||||
const PATH: Color = Color([247.0 / 255.0, 95.0 / 255.0, 28.0 / 255.0, 1.0]);
|
||||
|
||||
const LINE_WIDTH: f64 = 1.0;
|
||||
|
||||
|
@ -6,7 +6,6 @@ extern crate cpuprofiler;
|
||||
extern crate log;
|
||||
extern crate map_model;
|
||||
extern crate sim;
|
||||
#[macro_use]
|
||||
extern crate structopt;
|
||||
|
||||
use abstutil::LogAdapter;
|
||||
|
@ -10,13 +10,13 @@ use piston::input::Key;
|
||||
use std::f64;
|
||||
use std::process;
|
||||
|
||||
const WHITE: Color = [1.0; 4];
|
||||
const RED: Color = [1.0, 0.0, 0.0, 0.8];
|
||||
const GREEN: Color = [0.0, 1.0, 0.0, 0.8];
|
||||
const BLUE: Color = [0.0, 0.0, 1.0, 0.8];
|
||||
const BLACK: Color = [0.0, 0.0, 0.0, 0.3];
|
||||
const SOLID_BLACK: Color = [0.0, 0.0, 0.0, 0.9];
|
||||
const YELLOW: Color = [1.0, 1.0, 0.0, 0.8];
|
||||
const WHITE: Color = Color([1.0; 4]);
|
||||
const RED: Color = Color([1.0, 0.0, 0.0, 0.8]);
|
||||
const GREEN: Color = Color([0.0, 1.0, 0.0, 0.8]);
|
||||
const BLUE: Color = Color([0.0, 0.0, 1.0, 0.8]);
|
||||
const BLACK: Color = Color([0.0, 0.0, 0.0, 0.3]);
|
||||
const SOLID_BLACK: Color = Color([0.0, 0.0, 0.0, 0.9]);
|
||||
const YELLOW: Color = Color([1.0, 1.0, 0.0, 0.8]);
|
||||
|
||||
const KEY_CATEGORY: &str = "";
|
||||
|
||||
@ -351,12 +351,12 @@ impl Iterator for RelatedColors {
|
||||
fn next(&mut self) -> Option<Color> {
|
||||
self.count -= 2;
|
||||
let multiplier = 0.1 * (self.count as f32);
|
||||
Some([
|
||||
Some(Color([
|
||||
self.r * multiplier,
|
||||
self.g * multiplier,
|
||||
self.b * multiplier,
|
||||
0.8,
|
||||
])
|
||||
]))
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user