I need to create UIImage (bitmap?) filled with a solid colour so that it can be tinted and thus support Dark and Light mode changes Is there a way to do this in Swift?
Asked
Active
Viewed 79 times
1 Answers
0
Not the best way, but a quick and dirty way to do this would be make a UIView with a background the color you want and then use one of the many ways to go UIView -> UIImage. This stack overflow question here does exactly that: How to convert a UIView to an image Furthermore, looking at that code will give you some insights on how to do it the right way, with lower level graphics functions if you like.

Tom Schulz
- 612
- 6
- 23