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 SwiftUI
struct Colors {
static let accent:Color = Color(red: 0.89, green: 0.58, blue: 0.36)
static let offWhite:Color = Color(red: 0.97, green: 0.92, blue: 0.9)
static let mediumGrey:Color = Color(red: 0.62, green: 0.6, blue: 0.58)
static let darkGrey:Color = Color(red: 0.32, green: 0.31, blue: 0.3);
extension Color {
public static let accent = Color(red: 0.89, green: 0.58, blue: 0.36)
public static let offWhite = Color(red: 0.97, green: 0.92, blue: 0.9)
public static let mediumGrey = Color(red: 0.62, green: 0.6, blue: 0.58)
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 {
Circle()
.stroke(Colors.darkGrey, style: StrokeStyle(lineWidth: 2))
.stroke(Color.body, style: StrokeStyle(lineWidth: 2))
Circle()
.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))
}
}

View File

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