Skip to content

Commit b60debf

Browse files
author
Eric
committed
增加颜色转Image api
1 parent c15802c commit b60debf

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

CRBoostSwift/Classes/Foundation+CRBoost.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -818,4 +818,9 @@ extension UIColor {
818818
}
819819
return UIColor(red: red, green: green, blue: blue, alpha: alpha)
820820
}
821+
822+
@discardableResult
823+
public func image(size: CGSize = CGSize(width: 1, height: 1)) -> UIImage? {
824+
return UIImage.imageWithColor(self, size: size)
825+
}
821826
}

0 commit comments

Comments
 (0)