I have a red object: red_object = UIColor.red.cgColor
I would like to get the hue saturation brightness and alpha parameters of this 'red' so I can recode my red &object using more specific parameters.
This exercise would be a once off but I need these parameters.
I have tried cgColor.components but I don't think this is the right function:
red_test = UIColor.red.cgColor
let output = red_test.components
print(output) = Optional([1.0, 0.0, 0.0, 1.0])
but if I run the following
let circlePathT = UIBezierPath(arcCenter: CGPoint(x: x_mid,y: y_mid), radius: CGFloat(20), startAngle: CGFloat(0), endAngle:CGFloat(Double.pi * 2), clockwise: true)
let red_object = CAShapeLayer()
red_object.fillColor = UIColor(hue: 1, saturation: 0, brightness: 0, alpha: 1).cgColor
I get a black circle, not red. More specifically I am expecting
red_object.fillColor = UIColor(hue: 1, saturation: 0, brightness: 0, alpha: 1).cgColor
to equal
red_test = UIColor.red.cgColor
but it isn't