I working on a drawing app using UIKit and I am trying to create a function that receives a UIImageView as an argument detects the color and then return that UIImageView updated. For example the UIImageView.image
will contains a set of UIColors
s and my detectColor
will check if the image contains .systemGrey
then will take any pixel that contains that specific color and change it to .systemPink
and return the UIImageView
updated
For a beter explation here is an example of my function with pseudo code:
func updateColor(_ imageView: UIImageView ) -> UIImageView {
//.. initialize imageView
//... if imageView.image color has pixels in .systemGrey color then
//... change that color to .systemPink
//... return updated imageView
}
Like I said I only want to change that specific color taking into account that in some cases my UIImageView.image
multiple UIColor
s .Any Ideas, examples or suggestions will be much appreciated. Thanks!.