💄 Refactoring color management and extending to all views

- Thanks to @liza-kl for the color scheme <3
This commit is contained in:
Patrick Müller 2021-07-08 18:27:49 +02:00 committed by Patrick Müller
parent c49c5186e1
commit 600f4c9c76
7 changed files with 125 additions and 16 deletions

View File

@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "174",
"green" : "174",
"red" : "174"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.153",
"green" : "0.125",
"red" : "0.063"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "255",
"green" : "255",
"red" : "255"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "123",
"green" : "114",
"red" : "98"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "224",
"green" : "224",
"red" : "224"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "79",
"green" : "71",
"red" : "55"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -7,12 +7,7 @@
import SwiftUI import SwiftUI
import Foundation import Foundation
extension Color { extension Color {
// For Darkmode static let primaryColor = Color("PrimaryColor")
static let darkModeDarkColor = Color(red: 16 / 255, green: 32 / 255, blue: 39 / 255) static let darkColor = Color("DarkColor")
static let darkModePrimaryColor = Color(red: 55 / 255, green: 71 / 255, blue: 79 / 255) static let lightColor = Color("LightColor")
static let darkModeLightColor = Color(red: 98 / 255, green: 114 / 255, blue: 123 / 255)
// For Lightmode
static let lightkModeDarkColor = Color(red: 174 / 255, green: 174 / 255, blue: 174 / 255)
static let lightModePrimaryColor = Color(red: 224 / 255, green: 224 / 255, blue: 224 / 255)
static let lightModeLightColor = Color(red: 255 / 255, green: 255 / 255, blue: 255 / 255)
} }

View File

@ -33,7 +33,7 @@ struct HomeView: View {
.padding() .padding()
.background( .background(
RoundedRectangle(cornerRadius: 10) RoundedRectangle(cornerRadius: 10)
.fill(Color.darkModePrimaryColor) .fill(Color.primaryColor)
) )
Spacer() Spacer()
} }
@ -60,7 +60,7 @@ struct HomeView: View {
.padding() .padding()
.background( .background(
RoundedRectangle(cornerRadius: 10) RoundedRectangle(cornerRadius: 10)
.fill(Color.darkModePrimaryColor) .fill(Color.primaryColor)
) )
Spacer() Spacer()
} }
@ -247,7 +247,7 @@ struct UpcomingLecturesBlock: View {
.padding() .padding()
.background( .background(
RoundedRectangle(cornerRadius: 10) RoundedRectangle(cornerRadius: 10)
.fill(Color.darkModePrimaryColor) .fill(Color.primaryColor)
) )
} }
} }
@ -276,7 +276,7 @@ struct UpcomingExamsBlock: View {
.padding() .padding()
.background( .background(
RoundedRectangle(cornerRadius: 10) RoundedRectangle(cornerRadius: 10)
.fill(Color.darkModePrimaryColor) .fill(Color.primaryColor)
) )
.overlay( .overlay(
RoundedRectangle(cornerRadius: 10) RoundedRectangle(cornerRadius: 10)

View File

@ -54,7 +54,7 @@ struct LecturePlanItem: View {
} }
} }
.padding() .padding()
.foregroundColor(.white) .foregroundColor(.primary)
.background(Color.blue) .background(Color.blue)
.cornerRadius(15) .cornerRadius(15)
Spacer() Spacer()
@ -63,7 +63,7 @@ struct LecturePlanItem: View {
.padding() .padding()
.background( .background(
RoundedRectangle(cornerRadius: 10) RoundedRectangle(cornerRadius: 10)
.fill(Color.gray) .fill(Color.primaryColor)
) )
Spacer() Spacer()
} }

View File

@ -198,7 +198,7 @@ struct DayWithEventsBlock: View {
.padding() .padding()
.background( .background(
RoundedRectangle(cornerRadius: 10) RoundedRectangle(cornerRadius: 10)
.fill(Color(#colorLiteral(red: 0.2549019754, green: 0.2745098174, blue: 0.3019607961, alpha: 1))) .fill(Color.darkColor)
) )
} }
// When an event gets updated from child view, reload it here as this will not trigger the onAppear() function // When an event gets updated from child view, reload it here as this will not trigger the onAppear() function
@ -228,7 +228,7 @@ struct DayWithEventsBlock: View {
.padding() .padding()
.background( .background(
RoundedRectangle(cornerRadius: 10) RoundedRectangle(cornerRadius: 10)
.fill(Color.gray) .fill(Color.primaryColor)
) )
} }
} }