updated tint color

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2022-11-03 10:47:09 -05:00
parent d92b9c0c5d
commit 1fa97266c7

View File

@ -20,7 +20,7 @@ public struct ImageLabelAttribute: AttachmentLabelAttributeModel {
public var imageName: String?
public var image: UIImage?
public var frame: CGRect?
public var tintColor: UIColor
public var tintColor: UIColor?
public static func == (lhs: ImageLabelAttribute, rhs: ImageLabelAttribute) -> Bool {
lhs.isEqual(rhs)
}
@ -31,7 +31,7 @@ public struct ImageLabelAttribute: AttachmentLabelAttributeModel {
private func imageAttachment(image: UIImage) -> NSTextAttachment {
let attachment = NSTextAttachment()
attachment.image = image.withTintColor(tintColor)
attachment.image = tintColor != nil ? image.withTintColor(tintColor!) : image
attachment.bounds = frame ?? .init(x: 0, y: 0, width: image.size.width, height: image.size.height)
return attachment
}