diff --git a/ArkitDoushiQi/ArkitDoushiQi/ArkitDoushiQiApp.swift b/ArkitDoushiQi/ArkitDoushiQi/ArkitDoushiQiApp.swift index b42874f..cfe6191 100644 --- a/ArkitDoushiQi/ArkitDoushiQi/ArkitDoushiQiApp.swift +++ b/ArkitDoushiQi/ArkitDoushiQi/ArkitDoushiQiApp.swift @@ -7,7 +7,14 @@ import SwiftUI +enum Theme { + static let primary = Color("Primary") + static let secondary = Color("Secondary") + static let tertiary = Color("Tertiary") +} + @main + struct ArkitDoushiQiApp: App { @AppStorage("isDarkMode") private var isDarkMode = false var body: some Scene { diff --git a/ArkitDoushiQi/ArkitDoushiQi/Assets.xcassets/Color.colorset/Contents.json b/ArkitDoushiQi/ArkitDoushiQi/Assets.xcassets/Primary.colorset/Contents.json similarity index 73% rename from ArkitDoushiQi/ArkitDoushiQi/Assets.xcassets/Color.colorset/Contents.json rename to ArkitDoushiQi/ArkitDoushiQi/Assets.xcassets/Primary.colorset/Contents.json index 22c4bb0..6ea0e4d 100644 --- a/ArkitDoushiQi/ArkitDoushiQi/Assets.xcassets/Color.colorset/Contents.json +++ b/ArkitDoushiQi/ArkitDoushiQi/Assets.xcassets/Primary.colorset/Contents.json @@ -16,7 +16,7 @@ "appearances" : [ { "appearance" : "luminosity", - "value" : "dark" + "value" : "light" } ], "color" : { @@ -29,6 +29,19 @@ } }, "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "platform" : "ios", + "reference" : "darkTextColor" + }, + "idiom" : "universal" } ], "info" : { diff --git a/ArkitDoushiQi/ArkitDoushiQi/Assets.xcassets/Quaternary.colorset/Contents.json b/ArkitDoushiQi/ArkitDoushiQi/Assets.xcassets/Quaternary.colorset/Contents.json new file mode 100644 index 0000000..af7fd25 --- /dev/null +++ b/ArkitDoushiQi/ArkitDoushiQi/Assets.xcassets/Quaternary.colorset/Contents.json @@ -0,0 +1,56 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "1.000", + "green" : "1.000", + "red" : "1.000" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "light" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "1.000", + "green" : "1.000", + "red" : "1.000" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "1.000", + "green" : "1.000", + "red" : "1.000" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ArkitDoushiQi/ArkitDoushiQi/Assets.xcassets/Secundary.colorset/Contents.json b/ArkitDoushiQi/ArkitDoushiQi/Assets.xcassets/Secundary.colorset/Contents.json new file mode 100644 index 0000000..af7fd25 --- /dev/null +++ b/ArkitDoushiQi/ArkitDoushiQi/Assets.xcassets/Secundary.colorset/Contents.json @@ -0,0 +1,56 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "1.000", + "green" : "1.000", + "red" : "1.000" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "light" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "1.000", + "green" : "1.000", + "red" : "1.000" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "1.000", + "green" : "1.000", + "red" : "1.000" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ArkitDoushiQi/ArkitDoushiQi/Assets.xcassets/Tertiary.colorset/Contents.json b/ArkitDoushiQi/ArkitDoushiQi/Assets.xcassets/Tertiary.colorset/Contents.json new file mode 100644 index 0000000..de56107 --- /dev/null +++ b/ArkitDoushiQi/ArkitDoushiQi/Assets.xcassets/Tertiary.colorset/Contents.json @@ -0,0 +1,51 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "1.000", + "green" : "1.000", + "red" : "1.000" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "light" + } + ], + "color" : { + "platform" : "ios", + "reference" : "darkTextColor" + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "1.000", + "green" : "1.000", + "red" : "1.000" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Controls/ButtonComponent.swift b/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Controls/ButtonComponent.swift index 85c14c9..ed86c3f 100644 --- a/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Controls/ButtonComponent.swift +++ b/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Controls/ButtonComponent.swift @@ -25,11 +25,11 @@ struct ButtonComponent: View { .frame(maxWidth: .infinity) .padding(EdgeInsets(top: 10, leading: 32, bottom: 10, trailing: 32)) .controlSize(.large) - .foregroundColor(.white) + .foregroundColor(Color(UIColor(named: "Primary") ?? .black)) } .buttonBorderShape(.roundedRectangle) .buttonStyle(.borderedProminent) - .tint(.black) + .tint(Color(UIColor(named: "Tertiary") ?? .white)) } } diff --git a/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Controls/PhotoButtonComponent.swift b/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Controls/PhotoButtonComponent.swift index a4011fd..68abd33 100644 --- a/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Controls/PhotoButtonComponent.swift +++ b/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Controls/PhotoButtonComponent.swift @@ -44,7 +44,7 @@ struct accessCameraView: UIViewControllerRepresentable { } struct PhotoButtonComponent: View { - let Text : String + let Value : String @State private var showCamera = false @State private var selectedImage: UIImage? @State var image: UIImage? @@ -56,7 +56,7 @@ struct PhotoButtonComponent: View { .scaledToFit() } - Button("Open camera") { + Button(Value) { self.showCamera.toggle() } .fullScreenCover(isPresented: self.$showCamera) { @@ -68,6 +68,6 @@ struct PhotoButtonComponent: View { struct PhotoButtonComponent_Previews: PreviewProvider { static var previews: some View { - PhotoButtonComponent(Text : "Prendre Photo") + PhotoButtonComponent(Value : "Prendre Photo") } } diff --git a/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Controls/PickerComponent.swift b/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Controls/PickerComponent.swift index f81cf0e..dfcbc15 100644 --- a/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Controls/PickerComponent.swift +++ b/ArkitDoushiQi/ArkitDoushiQi/Views/Components/Controls/PickerComponent.swift @@ -33,11 +33,9 @@ struct PickerComponent: Vi } label: { HStack { Text(title) - .foregroundColor(.black) .padding() Spacer() Text(selectedOption.rawValue.description) - .foregroundColor(.black) .padding() } .frame(maxWidth: .infinity) diff --git a/ArkitDoushiQi/ArkitDoushiQi/Views/GameParametersMenu/GameParametersMenuView.swift b/ArkitDoushiQi/ArkitDoushiQi/Views/GameParametersMenu/GameParametersMenuView.swift index 4bd66a4..79893b5 100644 --- a/ArkitDoushiQi/ArkitDoushiQi/Views/GameParametersMenu/GameParametersMenuView.swift +++ b/ArkitDoushiQi/ArkitDoushiQi/Views/GameParametersMenu/GameParametersMenuView.swift @@ -41,8 +41,9 @@ struct GameParametersMenuView: View { EditComponent(explanation: "Nom du joueur 2",value: "Joueur 2") ButtonComponent(title: "Lancer la partie") { GameView() - } - }.frame(maxHeight: .infinity, alignment: .top) + }.padding(EdgeInsets(top: 10, leading: 32, bottom: 10, trailing: 32)) + } + .frame(maxHeight: .infinity, alignment: .top) } }