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

This commit is contained in:
Garth Vander Houwen 2023-09-02 08:50:23 -07:00
parent 7feaa7dd9c
commit 87a1115727
2 changed files with 3 additions and 3 deletions

View file

@ -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 {

View file

@ -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
}