Question : uicolor from hex swift
Answered by : mobile-star
extension UIColor { convenience init(hexaString: String, alpha: CGFloat = 1) { let chars = Array(hexaString.dropFirst()) self.init(red: .init(strtoul(String(chars[0...1]),nil,16))/255, green: .init(strtoul(String(chars[2...3]),nil,16))/255, blue: .init(strtoul(String(chars[4...5]),nil,16))/255, alpha: alpha)}
}
let redColor = UIColor(hexaString: "#FF0000") // r 1,0 g 0,0 b 0,0 a 1,0
let transparentRed = UIColor(hexaString: "#FF0000", alpha: 0.5) // r 1,0 g 0,0 b 0,0 a 0,5
Source : | Last Update : Wed, 10 Feb 21
Question : swift set uicolor
Answered by : angry-alpaca-wcpdwb2x8lo7
let swiftColor = UIColor(red: 1, green: 165/255, blue: 0, alpha: 1)
Source : https://www.codingexplorer.com/create-uicolor-swift/ | Last Update : Mon, 15 Jun 20
Question : swift ui color rgb
Answered by : thomas-long
let exampleColor : Color = Color(red: 141/255, green: 223/255, blue: 144/255)
Source : https://stackoverflow.com/questions/63627406/set-custom-background-color-on-a-stack-in-swift-swiftui | Last Update : Sat, 01 Oct 22