Mercurial > public > stock-charts
comparison Sources/StockCharts/CapsuleChart/CapsuleChartView.swift @ 106:0c0d38dca6d8
Change colours to native swiftUI
author | Dennis Concepción Martín <dennisconcepcionmartin@gmail.com> |
---|---|
date | Mon, 28 Jun 2021 13:48:03 +0200 |
parents | 766a1169564b |
children | f53d8b9ca92b |
comparison
equal
deleted
inserted
replaced
105:facd63329f23 | 106:0c0d38dca6d8 |
---|---|
15 } | 15 } |
16 public var body: some View { | 16 public var body: some View { |
17 ZStack { | 17 ZStack { |
18 GeometryReader { proxy in | 18 GeometryReader { proxy in |
19 Group { | 19 Group { |
20 #if os(iOS) | |
21 Capsule() | 20 Capsule() |
22 .foregroundColor(Color(.systemGray)) | 21 .foregroundColor(Color.gray) |
23 .opacity(0.2) | 22 .opacity(0.2) |
24 | 23 |
25 Capsule() | 24 Capsule() |
26 .foregroundColor(Color(.systemBlue)) | 25 .foregroundColor(Color.blue) |
27 .frame(width: proxy.size.width * percentageOfWidth) | 26 .frame(width: proxy.size.width * percentageOfWidth) |
28 #elseif os(watchOS) | |
29 Capsule() | |
30 .foregroundColor(Color(.gray)) | |
31 .opacity(0.2) | |
32 | |
33 Capsule() | |
34 .foregroundColor(Color(.blue)) | |
35 .frame(width: proxy.size.width * percentageOfWidth) | |
36 #endif | |
37 | |
38 } | 27 } |
39 .frame(height: 10) | 28 .frame(height: 10) |
40 } | 29 } |
41 } | 30 } |
42 } | 31 } |