Post

Replies

Boosts

Views

Activity

Color literal not displaying as Color Swatch?
Hi, should color literals work inside Views, I am sure this used to work? Xcode Version 13.0 (13A233) Note, myColor works, but the same literal in the fill does not. let myColor = Color(#colorLiteral(red: 0.292, green: 0.081, blue: 0.6, alpha: 255)) struct TestView: View {   var body: some View {     RoundedRectangle(cornerRadius: 25)       .fill(Color(#colorLiteral(red: 0.292, green: 0.081, blue: 0.6, alpha: 255)))       .frame(width: 100, height: 100)           } }
15
5
17k
Sep ’21