metatext-app-ios-iphone-ipad/Extensions/UIColor+Extensions.swift

13 lines
331 B
Swift
Raw Normal View History

2020-08-21 04:29:01 +02:00
// Copyright © 2020 Metabolist. All rights reserved.
import UIKit
extension UIColor {
func image(_ size: CGSize = CGSize(width: 1, height: 1)) -> UIImage {
UIGraphicsImageRenderer(size: size).image { context in
self.setFill()
context.fill(CGRect(origin: .zero, size: size))
}
}
}