@@ -20,25 +20,23 @@ public class ColorProvider {
2020 return [ String: UIColor] ( )
2121 }
2222
23- return colorDict. compactMapValues { ( value) -> UIColor ? in
24- return UIColor . init ( hexString: value)
25- }
23+ return colorDict. compactMapValues { UIColor ( hexString: $0) }
2624 } ( )
2725
2826 private var extraColors = [ String: UIColor] ( )
2927
3028 /// Adds extra named colors to be used by the `color(named:)` method.
31- /// If the there is a name collision the value on the added dictionary will overwrite the current color.
29+ /// If there is a name collision, the value in the added dictionary will overwrite the current color.
3230 /// - Parameter namedColors: a dictionary of colors keyed by name
3331 public func add( namedColors: [ String : UIColor ] ) {
3432 extraColors. merge ( namedColors) { ( base, other) -> UIColor in
3533 return other
3634 }
3735 }
3836
39- /// Returns a color designated by name if available.
40- /// By default the the color available are the one defined in the HTML specification: https://www.w3schools.com/colors/colors_names.asp
41- /// - Parameter name: the name of the color, or nil if the name is not available
37+ /// Returns a color designated by name or nil if the name is not available
38+ /// By default the the color available are the ones defined in the HTML specification: https://www.w3schools.com/colors/colors_names.asp
39+ /// - Parameter name: the name of the color
4240 public func color( named name: String ) -> UIColor ? {
4341 if let color = htmlColors [ name. lowercased ( ) ] {
4442 return color
@@ -49,9 +47,9 @@ public class ColorProvider {
4947
5048 public lazy var codeBackgroungColor : UIColor = {
5149 if #available( iOS 13 . 0 , * ) {
52- return UIColor . secondarySystemBackground
50+ return . secondarySystemBackground
5351 } else {
54- return UIColor . lightGray
52+ return . lightGray
5553 }
5654 } ( )
5755}
0 commit comments