The Color
initializer init(hue:saturation:brightness:opacity:)
is undocumented.
I think I can safely assume that saturation
, brightness
, and opacity
normalize to the range of 0...1
, where values outside that range are valid only for wide-gamut displays.
But I can't make this guess for hue
. Is is 0...1
, 0...τ
, or 0...360
?
Happily, it's easy to test this quickly.
I tossed this code into a new SwiftUI app and just looked at the preview to see the results. Turns out, it's
0...1
!