Skip to main content

2 posts tagged with "Color Management"

Color and image handling in iOS

View All Tags

How to convert HEX colors to UIColor in Swift 5?

· 2 min read
Full Stack Developer
Last updated on October 11, 2022

There are many situations when you want to create an UIColor object from a hex color string. In this post, we provide a code sample that will help you convert hex colors to UIColor objects. While generally, you can get away with this by manually converting the hex code to RGB (using an online converter, for example), there are scenarios where your colors are dynamic, so you'll need a utility method that converts the hex code to an RGB color in Swift 5.

How to color UIImage objects programmatically in Swift

· 2 min read
Full Stack Developer
Last updated on March 19, 2021

UIImage is the Swift approach to modeling images. In order to display an image on the screen, you’re most likely going to use UIImageView, which takes a UIImage object and presents it in the view hierarchy. To color UIImage objects there’s some extra work required. Coloring images can be very helpful when dealing with app icons, tab bar items, navigation items, etc.