getColor(p1, p2) {
			let d = this.distancePoint(p1, p2);
			let dx = (p2.getX() - p1.getX()) / d;
			let dy = (p2.getY() - p1.getY()) / d;
			let error = 0;
			let px = p1.getX();
			let py = p1.getY();
			let colorModel = this.image.get(p1.getX(), p1.getY());
			let iMax = Math.ceil(d);
			for (let i = 0; i < iMax; i++) {
				px += dx;
				py += dy;
				if (this.image.get(MathUtils.round(px), MathUtils.round(py)) !== colorModel) {
					error++;
				}
			}
			let errRatio = error / d;
			if (errRatio > 0.1 && errRatio < 0.9) {
				return 0;
			}
			return (errRatio <= 0.1) === colorModel ? 1 : -1;
		}
Gets the color of a segment

@return 1 if segment more than 90% black, -1 if segment is more than 90% white, 0 else