iOS-How to display Gold color
color values are between 0 to 1.0f
myView.backgroundColor=[UIColor colorWithRed:252.0/255.0
green:194.0/255.0 blue:0 alpha:1.0];
UIColor
takes color percentages, from 0-1, instead of 0-255. Divide those RGB values by 255.0 to get the desired color.
UIColor Reference
Xcode 11 Swift 5
you can work with color literals !
var gold = #colorLiteral(red: 0.9882352941, green: 0.7607843137, blue: 0, alpha: 1)
It renders like this ...