Bart Jacobs wrote a wonderful article From Hex to UIColor and Back in Swift and my article builds on top of his work. I was wondering how the same can be achieved in SwiftUI with its Color struct. From Hex to Color in SwiftUI You don't need UIKit for...

Markdown supported · ⌘↵ to post
Maximiliano taccone
Hello!!! thanks for the blog.!! An erro is in RGBA HexToUIColor
This works OK..
a = CGFloat((hexNumber & 0xff000000) >> 24) / 255 r = CGFloat((hexNumber & 0x00ff0000) >> 16) / 255 g = CGFloat((hexNumber & 0x0000ff00) >> 8) / 255 b = CGFloat(hexNumber & 0x000000ff) / 255
Best for you!! Maximiliano Taccone