From 2ef73c84e2033341741c53580e57cd8602e27bb2 Mon Sep 17 00:00:00 2001 From: Sagar Patel Date: Fri, 31 Jul 2020 07:13:56 -0400 Subject: [PATCH] Dark/Light mode fixes (#148) Fix for making text work with both Dark/Light mode. Also solves line chart background to appear white in dark mode --- Sources/SwiftUICharts/Base/Label/ChartLabel.swift | 8 ++++---- Sources/SwiftUICharts/Charts/LineChart/Line.swift | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Sources/SwiftUICharts/Base/Label/ChartLabel.swift b/Sources/SwiftUICharts/Base/Label/ChartLabel.swift index 2a8fb07..877bc2a 100644 --- a/Sources/SwiftUICharts/Base/Label/ChartLabel.swift +++ b/Sources/SwiftUICharts/Base/Label/ChartLabel.swift @@ -49,13 +49,13 @@ public struct ChartLabel: View { private var labelColor: Color { switch labelType { case .title: - return .black + return Color(UIColor.label) case .legend: - return .gray + return Color(UIColor.secondaryLabel) case .subTitle: - return .black + return Color(UIColor.label) case .largeTitle: - return .black + return Color(UIColor.label) case .custom(_, _, let color): return color } diff --git a/Sources/SwiftUICharts/Charts/LineChart/Line.swift b/Sources/SwiftUICharts/Charts/LineChart/Line.swift index 6b5a9c1..bae3a53 100644 --- a/Sources/SwiftUICharts/Charts/LineChart/Line.swift +++ b/Sources/SwiftUICharts/Charts/LineChart/Line.swift @@ -94,7 +94,7 @@ extension Line { .fill(LinearGradient(gradient: Gradient(colors: [ style.foregroundColor.first?.startColor ?? .white, style.foregroundColor.first?.endColor ?? .white, - .white]), + .clear]), startPoint: .bottom, endPoint: .top)) .rotationEffect(.degrees(180), anchor: .center)