mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-05 19:28:46 +02:00
40 lines
837 B
Swift
40 lines
837 B
Swift
import SwiftColor
|
|
import SwiftSVG
|
|
|
|
public extension Stroke {
|
|
@available(*, deprecated, renamed: "pigment")
|
|
var swiftColor: Pigment? { pigment }
|
|
|
|
var pigment: Pigment? {
|
|
guard let color, !color.isEmpty else {
|
|
return nil
|
|
}
|
|
|
|
let _color = Pigment(color)
|
|
guard _color.alpha != 0.0 else {
|
|
return nil
|
|
}
|
|
|
|
return _color
|
|
}
|
|
}
|
|
|
|
public extension Stroke.LineCap {
|
|
var coreGraphicsDescription: String {
|
|
switch self {
|
|
case .butt: ".butt"
|
|
case .round: ".round"
|
|
case .square: ".square"
|
|
}
|
|
}
|
|
}
|
|
|
|
public extension Stroke.LineJoin {
|
|
var coreGraphicsDescription: String {
|
|
switch self {
|
|
case .bevel: ".bevel"
|
|
case .arcs, .miter, .miterClip: ".miter"
|
|
case .round: ".round"
|
|
}
|
|
}
|
|
}
|