File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
Sources/ZMarkupParser/Core/MarkupStyle Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -106,10 +106,11 @@ extension MarkupStyleColor {
106106 }
107107
108108 public init ( color: UIColor ) {
109- self . red = Int ( CIColor ( color: color) . red * 255 )
110- self . green = Int ( CIColor ( color: color) . green * 255 )
111- self . blue = Int ( CIColor ( color: color) . blue * 255 )
112- self . alpha = CIColor ( color: color) . alpha
109+ let ciColor = CIColor ( color: color)
110+ self . red = Int ( ciColor. red * 255 )
111+ self . green = Int ( ciColor. green * 255 )
112+ self . blue = Int ( ciColor. blue * 255 )
113+ self . alpha = ciColor. alpha
113114 }
114115}
115116
@@ -122,10 +123,11 @@ extension MarkupStyleColor {
122123 }
123124
124125 public init ( color: NSColor ) {
125- self . red = Int ( ( CIColor ( color: color) ? . red ?? 0 ) * 255 )
126- self . green = Int ( ( CIColor ( color: color) ? . green ?? 0 ) * 255 )
127- self . blue = Int ( ( CIColor ( color: color) ? . blue ?? 0 ) * 255 )
128- self . alpha = CIColor ( color: color) ? . alpha ?? 1
126+ let ciColor = CIColor ( color: color)
127+ self . red = Int ( ( ciColor? . red ?? 0 ) * 255 )
128+ self . green = Int ( ( ciColor? . green ?? 0 ) * 255 )
129+ self . blue = Int ( ( ciColor? . blue ?? 0 ) * 255 )
130+ self . alpha = ciColor? . alpha ?? 1
129131 }
130132}
131133
You can’t perform that action at this time.
0 commit comments