Can I mix two UIColor together?

后端 未结 6 1513
暖寄归人
暖寄归人 2021-01-12 05:51

I have colorA which is [UIColor blueColor], and colorB, which is [UIColor redColor]. Is this possible for me to render a [UIColor purple]

6条回答
  •  南笙
    南笙 (楼主)
    2021-01-12 06:37

    If you want to use purple color then its not a big deal.All the UIColor are rgb color.You can simply pass the RGB value for each color and can get the desired color.Use this link to convert hex value of any color to convert in UIColor. http://www.touch-code-magazine.com/web-color-to-uicolor-convertor/

    like #color code for green is #008400: [UIColor colorWithRed:0 green:0.518 blue:0 alpha:1] /#008400/

提交回复
热议问题