getting things in place to get average color of an image

This commit is contained in:
talksik
2021-12-14 16:01:00 -08:00
parent 0e73234418
commit 58b6b1068d
4 changed files with 46 additions and 20 deletions
+13 -20
View File
@@ -9,42 +9,35 @@ import SwiftUI
struct HeaderView: View {
@EnvironmentObject var authStore:AuthSessionStore
private var averageColor: UIColor?
var body: some View {
HStack(alignment:.center) {
if self.authStore.sessionState == SessionState.isAuthenticated {
Image(systemName: "list.bullet.circle")
.font(Font.system(.largeTitle))
.padding()
.foregroundColor(NirvanaColor.teal)
}
Spacer()
HStack {
Image("undraw_handcrafts_leaf")
.resizable()
.frame(width: 20.0, height: 32.132)
Text("nirvana")
.font(Font.custom("Satisfy-Regular", size: 35))
.foregroundColor(NirvanaColor.teal)
.multilineTextAlignment(.center)
}
Image("undraw_handcrafts_leaf")
.resizable()
.frame(width: 20.0, height: 32.132)
.padding(.leading, 20)
Spacer()
if self.authStore.sessionState == SessionState.isAuthenticated {
RemoteImage(url: "https://avatars.githubusercontent.com/u/41487836")
.background(NirvanaColor.teal)
.aspectRatio(contentMode: .fit)
.aspectRatio(contentMode: .fill)
.frame(width: 40, height: 40)
.clipShape(Circle())
.padding()
.shadow(radius:5)
.onAppear {
self.setAverageColor()
}
}
}
.frame(maxWidth: .infinity)
}
private func setAverageColor() {
}
}
struct HeaderView_Previews: PreviewProvider {