[iOS] fix elevation chart color in night mode

https://jira.mail.ru/browse/MAPSME-13651
This commit is contained in:
Aleksey Belousov 2020-04-14 10:52:00 +03:00 committed by Alexander Boriskov
parent 8661541de5
commit cb762c2bef
4 changed files with 11 additions and 3 deletions

View file

@ -73,6 +73,6 @@ class ChartPointIntersectionView: UIView {
func updatePoint(_ point: ChartLineInfo) {
intersectionView.center = CGPoint(x: bounds.midX, y: point.point.y)
color = point.color
}
}

View file

@ -67,6 +67,8 @@ class DayColors: IColors {
var elevationPreviewTint = UIColor(193, 209, 224, alpha30)
var elevationPreviewSelector = UIColor(red: 0.757, green: 0.82, blue: 0.878, alpha: 1)
var shadow = UIColor(0, 0, 0, alpha100)
var chartLine = UIColor(red: 0.118, green: 0.588, blue: 0.941, alpha: 1)
var chartShadow = UIColor(red: 0.118, green: 0.588, blue: 0.941, alpha: 0.12)
}
class NightColors: IColors {
@ -138,4 +140,6 @@ class NightColors: IColors {
var elevationPreviewTint = UIColor(0, 0, 0, alpha54)
var elevationPreviewSelector = UIColor(red: 0.404, green: 0.439, blue: 0.475, alpha: 1)
var shadow = UIColor.clear
var chartLine = UIColor(red: 0.294, green: 0.725, blue: 0.902, alpha: 1)
var chartShadow = UIColor(red: 0.294, green: 0.725, blue: 0.902, alpha: 0.12)
}

View file

@ -77,4 +77,6 @@ let alpha100: CGFloat = 1.0
var elevationPreviewSelector: UIColor { get }
var elevationPreviewTint: UIColor { get }
var shadow: UIColor { get }
var chartLine: UIColor { get }
var chartShadow: UIColor { get }
}

View file

@ -160,8 +160,10 @@ fileprivate struct ElevationProfileChartData {
let values = points.map { Int($0.altitude) }
distances = points.map { $0.distance }
let color = UIColor(red: 0.12, green: 0.59, blue: 0.94, alpha: 1)
let l1 = Line(values: values, name: "Altitude", color: color, type: .line)
let l2 = Line(values: values, name: "Altitude", color: color.withAlphaComponent(0.12), type: .lineArea)
let lineColor = StyleManager.shared.theme?.colors.chartLine ?? color
let lineShadowColor = StyleManager.shared.theme?.colors.chartShadow ?? color.withAlphaComponent(0.12)
let l1 = Line(values: values, name: "Altitude", color: lineColor, type: .line)
let l2 = Line(values: values, name: "Altitude", color: lineShadowColor, type: .lineArea)
chartLines = [l1, l2]
}