Cleanup colors implementation

This commit is contained in:
Shawn 2023-10-23 21:40:55 -06:00
parent b188e77449
commit d783d706e1
3 changed files with 13 additions and 11 deletions

View File

@ -1,9 +1,10 @@
import Foundation import Foundation
import SwiftUI import SwiftUI
struct Colors { extension Color {
static let accent:Color = Color(red: 0.89, green: 0.58, blue: 0.36) public static let accent = Color(red: 0.89, green: 0.58, blue: 0.36)
static let offWhite:Color = Color(red: 0.97, green: 0.92, blue: 0.9) public static let offWhite = Color(red: 0.97, green: 0.92, blue: 0.9)
static let mediumGrey:Color = Color(red: 0.62, green: 0.6, blue: 0.58) public static let mediumGrey = Color(red: 0.62, green: 0.6, blue: 0.58)
static let darkGrey:Color = Color(red: 0.32, green: 0.31, blue: 0.3); public static let darkGrey = Color(red: 0.15, green: 0.15, blue: 0.15)
public static let body = Color(red: 0.32, green: 0.31, blue: 0.3);
} }

View File

@ -37,10 +37,10 @@ struct GaugeProgressStyle: ProgressViewStyle {
return ZStack { return ZStack {
Circle() Circle()
.stroke(Colors.darkGrey, style: StrokeStyle(lineWidth: 2)) .stroke(Color.body, style: StrokeStyle(lineWidth: 2))
Circle() Circle()
.trim(from: 0, to: fractionCompleted) .trim(from: 0, to: fractionCompleted)
.stroke(Colors.accent, style: StrokeStyle(lineWidth: 4, lineCap: .round)) .stroke(Color.accent, style: StrokeStyle(lineWidth: 4, lineCap: .round))
.rotationEffect(.degrees(90)) .rotationEffect(.degrees(90))
} }
} }

View File

@ -20,7 +20,7 @@ struct WonderousWidgetView : View {
if(showTitle) { if(showTitle) {
Text("Collection") Text("Collection")
.font(.system(size: 15)) .font(.system(size: 15))
.foregroundColor(Colors.offWhite) .foregroundColor(.offWhite)
} }
Spacer(); Spacer();
if(showIcon) { if(showIcon) {
@ -39,7 +39,7 @@ struct WonderousWidgetView : View {
.foregroundColor(.white); .foregroundColor(.white);
Text(subTitle) Text(subTitle)
.font(.system(size: 15)) .font(.system(size: 15))
.foregroundColor(Colors.mediumGrey); .foregroundColor(.mediumGrey);
} }
} }
Spacer(); Spacer();
@ -52,8 +52,9 @@ struct WonderousWidgetView : View {
} }
} }
ZStack{ return ZStack{
BgImage(entry: entry) Color.darkGrey
BgImage(entry: entry).opacity(0.8)
LinearGradient( LinearGradient(
gradient: Gradient(colors: [.black.opacity(0), .black]), gradient: Gradient(colors: [.black.opacity(0), .black]),
startPoint: .center, startPoint: .center,