[gnome-maps] transitWalkMarker: Use default color fallback from TransitPlan



commit 4e7890b91c95d8b6e18b0375de91169a7c9dc4f2
Author: Marcus Lundblad <ml update uu se>
Date:   Sun Oct 1 21:39:50 2017 +0200

    transitWalkMarker: Use default color fallback from TransitPlan
    
    https://bugzilla.gnome.org/show_bug.cgi?id=788407

 src/transitWalkMarker.js |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/src/transitWalkMarker.js b/src/transitWalkMarker.js
index fb2b508..fca04cc 100644
--- a/src/transitWalkMarker.js
+++ b/src/transitWalkMarker.js
@@ -23,6 +23,7 @@ const Lang = imports.lang;
 
 const Gdk = imports.gi.Gdk;
 
+const Color = imports.color;
 const Location = imports.location;
 const MapMarker = imports.mapMarker;
 const Place = imports.place;
@@ -43,6 +44,9 @@ var TransitWalkMarker = new Lang.Class({
         else
             point = params.leg.polyline[0];
 
+        let bgColor = params.leg.color ? params.leg.color :
+                                         TransitPlan.DEFAULT_ROUTE_COLOR;
+
         delete params.leg;
         delete params.previousLeg;
 
@@ -54,9 +58,12 @@ var TransitWalkMarker = new Lang.Class({
 
         this.parent(params);
 
-        let color = new Gdk.RGBA({ red: 0,
-                                   green: 0,
-                                   blue: 0,
+        let bgRed = Color.parseColor(bgColor, 0);
+        let bgGreen = Color.parseColor(bgColor, 1);
+        let bgBlue = Color.parseColor(bgColor, 2);
+        let color = new Gdk.RGBA({ red: bgRed,
+                                   green: bgGreen,
+                                   blue: bgBlue,
                                    alpha: 1.0
                                  });
         let actor =


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]