I get HSB as 29, 90, 100.

How to convert it to the range 0…1?

UIColor is initialized only in this range, so I have a question.

```
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
```

### >Solution :

Looks like your hue range is `0...360`

and your saturation and brightness are `0...100`

. You just need to convert your integer to double and divide by 360 or 100:

```
let color2 = UIColor(hue: Double(hueOut)/360, saturation: Double(satOut)/100, brightness: Double(brightnessOut)/100, alpha: 1.0)
```

This will result in `r 1.0 g 0.535 b 0.1 a 1.0`