Compare commits

..

1 Commits

Author SHA1 Message Date
Andras Samu 40f9210205 Refactor Chart base 2020-07-25 18:56:08 +02:00
2 changed files with 8 additions and 13 deletions
@@ -4,22 +4,17 @@ public struct CardView<Content: View>: View, ChartBase {
public var chartData = ChartData()
let content: () -> Content
private var showShadow: Bool
@EnvironmentObject var style: ChartStyle
public init(showShadow: Bool = true, @ViewBuilder content: @escaping () -> Content) {
self.showShadow = showShadow
public init(@ViewBuilder content: @escaping () -> Content) {
self.content = content
}
public var body: some View {
ZStack{
if showShadow {
RoundedRectangle(cornerRadius: 20)
.fill(Color.white)
.shadow(color: Color.gray, radius: 8)
}
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
public static let orangeBright = Color(hexString: "#FF782C")
public static let orangeDark = Color(hexString: "#EC2301")
static let orangeBright = Color(hexString: "#FF782C")
static let orangeDark = Color(hexString: "#EC2301")
public static let legendColor: Color = Color(hexString: "#E8E7EA")
public static let indicatorKnob: Color = Color(hexString: "#FF57A6")
static let legendColor: Color = Color(hexString: "#E8E7EA")
static let indicatorKnob: Color = Color(hexString: "#FF57A6")
}