// Contains the creation of the blue image import UIKit // Global variables func createBlueImage(_ tamanho: CGSize) -> UIImage { UIGraphicsBeginImageContext(tamanho) if let contexto = UIGraphicsGetCurrentContext() { contexto.setFillColor(UIColor.blue.cgColor) contexto.fill(CGRect(origin: .zero, size: tamanho)) } let imagemAzul = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() return imagemAzul ?? UIImage() }