Compare commits

..

2 Commits

Author SHA1 Message Date
Andras Samu 3265d3e16b Add public modifier to ChartColors and add showShadow property 2020-07-25 19:32:05 +02:00
Andras Samu c46902dab8 Refactor Chart base (#143) 2020-07-25 18:56:58 +02:00
2 changed files with 13 additions and 8 deletions
@@ -4,17 +4,22 @@ public struct CardView<Content: View>: View, ChartBase {
public var chartData = ChartData()
let content: () -> Content
private var showShadow: Bool
@EnvironmentObject var style: ChartStyle
public init(@ViewBuilder content: @escaping () -> Content) {
public init(showShadow: Bool = true, @ViewBuilder content: @escaping () -> Content) {
self.showShadow = showShadow
self.content = content
}
public var body: some View {
ZStack{
RoundedRectangle(cornerRadius: 20)
.fill(Color.white)
.shadow(color: Color.gray, radius: 8)
if showShadow {
RoundedRectangle(cornerRadius: 20)
.fill(Color.white)
.shadow(color: Color.gray, radius: 8)
}
VStack {
self.content()
}
@@ -2,9 +2,9 @@ import SwiftUI
public enum ChartColors {
// Orange
static let orangeBright = Color(hexString: "#FF782C")
static let orangeDark = Color(hexString: "#EC2301")
public static let orangeBright = Color(hexString: "#FF782C")
public static let orangeDark = Color(hexString: "#EC2301")
static let legendColor: Color = Color(hexString: "#E8E7EA")
static let indicatorKnob: Color = Color(hexString: "#FF57A6")
public static let legendColor: Color = Color(hexString: "#E8E7EA")
public static let indicatorKnob: Color = Color(hexString: "#FF57A6")
}