How to get color components of a CGColor correctly

后端 未结 6 1189
日久生厌
日久生厌 2021-01-02 14:04

I have a UILabel with black color;

i am writing the following code to get black color\'s components.

UIColor *aColor = [aLabel.textColor retain];
con         


        
6条回答
  •  醉话见心
    2021-01-02 14:16

    working exampel with UIColor: CALayer * btnLayer = [myLittleButton layer];

    [layer setBackgroundColor:<#(CGColorRef)#>] becomes: [btnLayer setBorderColor:[[UIColor grayColor] CGColor]];

    just make sure the buttons original colors doesnt cover the layer

提交回复
热议问题