💄 Added a Color Extension with some rgb color codes for light and darkmode

This commit is contained in:
2021-05-11 15:13:07 +02:00
parent 543bd190eb
commit 590e89fb1a
3 changed files with 31 additions and 7 deletions
+18
View File
@@ -0,0 +1,18 @@
//
// ColorExtension.swift
// DHBW-Service
//
// Created by Lisa Kletsko on 11.05.21.
//
import SwiftUI
import Foundation
extension Color {
// For Darkmode
static let darkModeDarkColor = Color(red: 16 / 255, green: 32 / 255, blue: 39 / 255)
static let darkModePrimaryColor = Color(red: 55 / 255, green: 71 / 255, blue: 79 / 255)
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)
}
+9 -7
View File
@@ -33,7 +33,7 @@ struct HomeView: View {
.padding()
.background(
RoundedRectangle(cornerRadius: 10)
.fill(Color.gray)
.fill(Color.darkModePrimaryColor)
)
Spacer()
}
@@ -41,7 +41,8 @@ struct HomeView: View {
Spacer()
VStack {
Text("information".localized(tableName: "HomeView", plural: false))
.font(.title3)
.font(.headline)
.fontWeight(.semibold)
.frame(maxWidth: .infinity, alignment: .leading)
HStack {
VStack(alignment: .leading) {
@@ -59,7 +60,7 @@ struct HomeView: View {
.padding()
.background(
RoundedRectangle(cornerRadius: 10)
.fill(Color.gray)
.fill(Color.darkModePrimaryColor)
)
Spacer()
}
@@ -228,7 +229,8 @@ struct UpcomingLecturesBlock: View {
var body: some View {
VStack {
Text(titleKey.localized(tableName: "HomeView"))
.font(.title)
.font(.title2)
.fontWeight(.semibold)
.frame(maxWidth: .infinity, alignment: .leading)
VStack {
if(!eventsList.isEmpty){
@@ -245,7 +247,7 @@ struct UpcomingLecturesBlock: View {
.padding()
.background(
RoundedRectangle(cornerRadius: 10)
.fill(Color.gray)
.fill(Color.darkModePrimaryColor)
)
}
}
@@ -274,11 +276,11 @@ struct UpcomingExamsBlock: View {
.padding()
.background(
RoundedRectangle(cornerRadius: 10)
.fill(Color.gray)
.fill(Color.darkModePrimaryColor)
)
.overlay(
RoundedRectangle(cornerRadius: 10)
.stroke(Color.red, lineWidth: 4)
.stroke(Color("AccentColor"), lineWidth: 4)
)
}
}