
How to convert SwiftUI Color into Hex and from Hex into Color with help of UIColor or CGColor respectively. Extension implementations are shared.
#Swift #iOS SDK architect 🇺🇸 🇩🇪
I am a Software Engineer working on open source and enterprise mobile SDKs for iOS and MacOS developers written in Swift. From 🇩🇪 and happily living in 🇺🇸
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