'Color' cannot be constructed

Hi all, I got an error: 'Color' cannot be constructed because it has no accessible initializers. The error I get from the statement: .background(Color(uiColor: UIColor(red: 0.93, green: 0.93, blue: 0.94, alpha: 1.00)))

I always use it but it's failed now. Is there anyone have the same issues? Please give me an advice of how I can fix it.

Thanks

Replies

Effectively, that should work (it does with Xcode 14.2).

You could try:

.background(Color(red: 0.93, green: 0.93, blue: 0.94))

Are you sure you have not a Color extension that creates a problem ?

You are right, it is because I create an enum named Color. I changed its name and it worked. Thank you very much.