0001 // 0002 // BackgroundColor.swift 0003 // Rainbow 0004 // 0005 // Created by Wei Wang on 15/12/22. 0006 // 0007 // Copyright (c) 2015 Wei Wang <onevcat@gmail.com> 0008 // 0009 // Permission is hereby granted, free of charge, to any person obtaining a copy 0010 // of this software and associated documentation files (the "Software"), to deal 0011 // in the Software without restriction, including without limitation the rights 0012 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 0013 // copies of the Software, and to permit persons to whom the Software is 0014 // furnished to do so, subject to the following conditions: 0015 // 0016 // The above copyright notice and this permission notice shall be included in 0017 // all copies or substantial portions of the Software. 0018 // 0019 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 0020 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 0021 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 0022 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 0023 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 0024 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 0025 // THE SOFTWARE. 0026 0027 /// Valid background colors to use in `Rainbow`. 0028 public enum BackgroundColor: UInt8, ModeCode { 0029 case Black
CodesParser.swift:30 (color: Color?, backgroundColor: BackgroundColor?, styles: [Style]?)CodesParser.swift:35 func parseModeCodes(codes: [UInt8]) -> (color: Color?, backgroundColor: BackgroundColor?, styles: [Style]?) {CodesParser.swift:37 var backgroundColor: BackgroundColor? = nilCodesParser.swift:43 } else if let bg = BackgroundColor(rawValue: code) {CodesParser.swift:59 func parseModeCodes(codes: [String]) -> (color: Color?, backgroundColor: BackgroundColor?, styles: [Style]?) {CodesParser.swift:61 var backgroundColor: BackgroundColor? = nilCodesParser.swift:66 } else if let bg = BackgroundColor(xcodeColorsDescription: code) {Rainbow.swift:50 -> (color: Color?, backgroundColor: BackgroundColor?, styles: [Style]?, text: String)Rainbow.swift:66 backgroundColor: BackgroundColor?,String+Rainbow.swift:62 public func stringByApplyingBackgroundColor(color: BackgroundColor) -> String {StringGenerator.swift:28 func generateStringColor(color: Color?, backgroundColor: BackgroundColor?, styles: [Style]?, text: String) -> StringStringGenerator.swift:32 func generateStringColor(color: Color?, backgroundColor: BackgroundColor?, styles: [Style]?, text: String) -> String {StringGenerator.swift:53 func generateStringColor(color: Color?, backgroundColor: BackgroundColor?, styles: [Style]?, text: String) -> String {XcodeColorsSupport.swift:80 extension BackgroundColor: XcodeColorsConvertible {XcodeColorsSupport.swift:97 case BackgroundColor.Black.xcodeColorsDescription: self = .BlackXcodeColorsSupport.swift:98 case BackgroundColor.Red.xcodeColorsDescription: self = .RedXcodeColorsSupport.swift:99 case BackgroundColor.Green.xcodeColorsDescription: self = .GreenXcodeColorsSupport.swift:100 case BackgroundColor.Yellow.xcodeColorsDescription: self = .YellowXcodeColorsSupport.swift:101 case BackgroundColor.Blue.xcodeColorsDescription: self = .BlueXcodeColorsSupport.swift:102 case BackgroundColor.Magenta.xcodeColorsDescription: self = .MagentaXcodeColorsSupport.swift:103 case BackgroundColor.Cyan.xcodeColorsDescription: self = .CyanXcodeColorsSupport.swift:104 case BackgroundColor.White.xcodeColorsDescription: self = .White= 40 0030 case Red
String+Rainbow.swift:228 public var onBlack: String { return stringByApplyingBackgroundColor(.Black) }XcodeColorsSupport.swift:83 case .Black: return "bg0,0,0"XcodeColorsSupport.swift:97 case BackgroundColor.Black.xcodeColorsDescription: self = .BlackXcodeColorsSupport.swift:97 case BackgroundColor.Black.xcodeColorsDescription: self = .Black0031 case Green
String+Rainbow.swift:230 public var onRed: String { return stringByApplyingBackgroundColor(.Red) }XcodeColorsSupport.swift:84 case .Red: return "bg255,0,0"XcodeColorsSupport.swift:98 case BackgroundColor.Red.xcodeColorsDescription: self = .RedXcodeColorsSupport.swift:98 case BackgroundColor.Red.xcodeColorsDescription: self = .Red0032 case Yellow
String+Rainbow.swift:232 public var onGreen: String { return stringByApplyingBackgroundColor(.Green) }XcodeColorsSupport.swift:85 case .Green: return "bg0,204,0"XcodeColorsSupport.swift:99 case BackgroundColor.Green.xcodeColorsDescription: self = .GreenXcodeColorsSupport.swift:99 case BackgroundColor.Green.xcodeColorsDescription: self = .Green0033 case Blue
String+Rainbow.swift:234 public var onYellow: String { return stringByApplyingBackgroundColor(.Yellow) }XcodeColorsSupport.swift:86 case .Yellow: return "bg255,255,0"XcodeColorsSupport.swift:100 case BackgroundColor.Yellow.xcodeColorsDescription: self = .YellowXcodeColorsSupport.swift:100 case BackgroundColor.Yellow.xcodeColorsDescription: self = .Yellow0034 case Magenta
String+Rainbow.swift:236 public var onBlue: String { return stringByApplyingBackgroundColor(.Blue) }XcodeColorsSupport.swift:87 case .Blue: return "bg0,0,255"XcodeColorsSupport.swift:101 case BackgroundColor.Blue.xcodeColorsDescription: self = .BlueXcodeColorsSupport.swift:101 case BackgroundColor.Blue.xcodeColorsDescription: self = .Blue0035 case Cyan
String+Rainbow.swift:238 public var onMagenta: String { return stringByApplyingBackgroundColor(.Magenta) }XcodeColorsSupport.swift:88 case .Magenta: return "bg255,0,255"XcodeColorsSupport.swift:102 case BackgroundColor.Magenta.xcodeColorsDescription: self = .MagentaXcodeColorsSupport.swift:102 case BackgroundColor.Magenta.xcodeColorsDescription: self = .Magenta0036 case White
String+Rainbow.swift:240 public var onCyan: String { return stringByApplyingBackgroundColor(.Cyan) }XcodeColorsSupport.swift:89 case .Cyan: return "bg0,255,255"XcodeColorsSupport.swift:103 case BackgroundColor.Cyan.xcodeColorsDescription: self = .CyanXcodeColorsSupport.swift:103 case BackgroundColor.Cyan.xcodeColorsDescription: self = .Cyan0037 case Default
String+Rainbow.swift:242 public var onWhite: String { return stringByApplyingBackgroundColor(.White) }XcodeColorsSupport.swift:90 case .White: return "bg204,204,204"XcodeColorsSupport.swift:104 case BackgroundColor.White.xcodeColorsDescription: self = .WhiteXcodeColorsSupport.swift:104 case BackgroundColor.White.xcodeColorsDescription: self = .White= 49 0038 0039 public var value
String+Rainbow.swift:79 return stringByApplyingBackgroundColor(.Default)StringGenerator.swift:63 if let backgroundColor = backgroundColor where backgroundColor != .Default {XcodeColorsSupport.swift:91 case .Default: return "": UInt8 { 0040 return rawValue 0041 } 0042 } 0043
StringGenerator.swift:38 codes.append(backgroundColor.value)