From 87a1115727de77445b53e1928ffce6445af03126 Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Sat, 2 Sep 2023 08:50:23 -0700 Subject: [PATCH] Adjust map pin darker and lighter logic so that the latest pin is darker than the node color and history pins and route lines are lighter --- Meshtastic/Extensions/UIColor.swift | 2 +- Meshtastic/Views/Map/Custom/MapViewSwiftUI.swift | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Meshtastic/Extensions/UIColor.swift b/Meshtastic/Extensions/UIColor.swift index 83623967..6a8909b9 100644 --- a/Meshtastic/Extensions/UIColor.swift +++ b/Meshtastic/Extensions/UIColor.swift @@ -31,7 +31,7 @@ extension UIColor { } func darker(componentDelta: CGFloat = 0.1) -> UIColor { - return makeColor(componentDelta: -2*componentDelta) + return makeColor(componentDelta: -1*componentDelta) } private func add(_ value: CGFloat, toComponent: CGFloat) -> CGFloat { diff --git a/Meshtastic/Views/Map/Custom/MapViewSwiftUI.swift b/Meshtastic/Views/Map/Custom/MapViewSwiftUI.swift index 0373daf9..10c32e2e 100644 --- a/Meshtastic/Views/Map/Custom/MapViewSwiftUI.swift +++ b/Meshtastic/Views/Map/Custom/MapViewSwiftUI.swift @@ -293,7 +293,7 @@ struct MapViewSwiftUI: UIViewRepresentable { annotationView.displayPriority = .required annotationView.titleVisibility = .visible } else { - annotationView.markerTintColor = UIColor(hex: UInt32(positionAnnotation.nodePosition?.num ?? 0)) + annotationView.markerTintColor = UIColor(hex: UInt32(positionAnnotation.nodePosition?.num ?? 0)).lighter() annotationView.displayPriority = .defaultHigh annotationView.titleVisibility = .adaptive } @@ -441,7 +441,7 @@ struct MapViewSwiftUI: UIViewRepresentable { if let routePolyline = overlay as? MKPolyline { let titleString = routePolyline.title ?? "0" let renderer = MKPolylineRenderer(polyline: routePolyline) - renderer.strokeColor = UIColor(hex: UInt32(titleString) ?? 0) + renderer.strokeColor = UIColor(hex: UInt32(titleString) ?? 0).lighter() renderer.lineWidth = 8 return renderer }