Hello. I am creating a widget for my existing app. The main app uses a two color linear gradient throughout and I want the widget to do the same. Black at the top and my custom color of #06539F (ANCBlue). So, I create a custom color set in assets named ANCBlue with the above hex code. Then, I create an extension file:
"import SwiftUI
struct ColorManager {
static let ancBlue = Color("ANCBlue")
}"
I then put this line of code in my WidgetEntryView:
".background(LinearGradient(gradient: Gradient(colors: [.black, ColorManager.ancBlue]), startPoint: .top, endPoint: .bottom))"
This produces my gradient as black and green, not my wanted colors of black and ANCBlue. For the life of me, I cannot figure out why Xcode is changing the custom blue color (ANCBlue) into a green color. If I change the above line to just a solid background using my custom blue color, it shows just fine. Change it back to gradient with black and my custom blue, and the blue displays as green. Please help!
"import SwiftUI
struct ColorManager {
static let ancBlue = Color("ANCBlue")
}"
I then put this line of code in my WidgetEntryView:
".background(LinearGradient(gradient: Gradient(colors: [.black, ColorManager.ancBlue]), startPoint: .top, endPoint: .bottom))"
This produces my gradient as black and green, not my wanted colors of black and ANCBlue. For the life of me, I cannot figure out why Xcode is changing the custom blue color (ANCBlue) into a green color. If I change the above line to just a solid background using my custom blue color, it shows just fine. Change it back to gradient with black and my custom blue, and the blue displays as green. Please help!