Skip to content

Commit

Permalink
Add public modifier to ChartColors and add showShadow property
Browse files Browse the repository at this point in the history
  • Loading branch information
AppPear committed Jul 25, 2020
1 parent c46902d commit 3265d3e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
13 changes: 9 additions & 4 deletions Sources/SwiftUICharts/Base/CardView/CardView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
8 changes: 4 additions & 4 deletions Sources/SwiftUICharts/Base/Style/Colors.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

0 comments on commit 3265d3e

Please sign in to comment.