我得到 HSB 为 29、90、100。如何将其转换为 0...1 范围?UIColor 只在这个范围内初始化,所以我有一个问题。
let red: CGFloat = 1
let green: CGFloat = 0.5372
let blue: CGFloat = 0.0941
let hueOut = 29
let satOut = 90
let brightnessOut = 100
let color = UIColor(red: red, green: green, blue: blue, alpha: 1.0)
///r 1,0 g 0,537 b 0,094 a 1,0
let color2 = UIColor(hue: hueOut, saturation: satOut, brightness: brightnessOut, alpha: 1.0)
///r -9,0 g 0,0 b -3,0 a 1,0