1

This question may ask several time. But I want to know exact answer for this. Question is simple, want to create UIColor from multiple color with Gradient effect? But I don't want to following concepts. Instead I research to do this by simple way. ex. make colorspace with multiple color and convert directly into UIColor.

More stuff concepts are:

1) Image creation with CGGradientRef and then convert into UIColor from UIImage

2) Drawing gradient color by CGContextDrawLinearGradient

3) Inserting CAGradientLayer to view's layer(see @Mirko Froehlich's answer)

Community
  • 1
  • 1
Mani
  • 17,549
  • 13
  • 79
  • 100
  • @TheKing Did you see my question fully, first read my question. – Mani Feb 20 '14 at 09:22
  • can you explain what you want? Do you want to draw a color gradient? – Volker Feb 20 '14 at 09:23
  • No. Simply say, Need gradient color from multiple color. But It's an fast and repeating process in view. So I want to know how can we create it effectively ie costless. If you draw on view means, It will take some time(I know it's toll small). But I don't want. – Mani Feb 20 '14 at 09:28
  • Does that mean you want a single color from the gradient? Or do you mean you want to mix multiple colors and take the result as a single color? – Volker Feb 20 '14 at 09:32
  • You asked two question.. I think two questions are same. I want one gradient color from mixed of multiple color? Did you get? – Mani Feb 20 '14 at 09:34
  • You want a UIColor that represents a gradient, then do you want to use it to set the background colour of some views..? :/ Is it a dynamic gradient or will it always be the same? – George Green Feb 20 '14 at 11:11
  • It is dynamic gradient which will gradually change 10-30 times within seconds. – Mani Feb 20 '14 at 12:00
  • Possible duplicate of [Programmatically create a UIView with color gradient](https://stackoverflow.com/questions/23074539/programmatically-create-a-uiview-with-color-gradient) – Joseph Jan 03 '19 at 21:38

0 Answers0