Color
public struct Color : HashableThis structure represents a color. Property values must be between 0 and 1.
Supported color spaces:
- 
                  
                  Returns the red color in PDFColorSpace.deviceRGBspaceDeclarationSwift public static let red: Color
- 
                  
                  Returns the green color in PDFColorSpace.deviceRGBspaceDeclarationSwift public static let green: Color
- 
                  
                  Returns the blue color in PDFColorSpace.deviceRGBspaceDeclarationSwift public static let blue: Color
- 
                  
                  Returns the black color in PDFColorSpace.deviceGrayspaceDeclarationSwift public static let black: Color
- 
                  
                  Returns the white color in PDFColorSpace.deviceGrayspaceDeclarationSwift public static let white: Color
- 
                  
                  Returns the transparent white color in PDFColorSpace.deviceGrayspaceDeclarationSwift public static let clear: Color
- 
                  
                  The color space associated with the color. DeclarationSwift public var colorSpace: PDFColorSpace { get }
- 
                  
                  The value of the alpha component associated with the color. DeclarationSwift public var alpha: Float
- 
                  
                  The direct value of the red component associated with the color if the colorSpaceis.deviceRGB, or the computed value otherwise.DeclarationSwift public var red: Float { get set }
- 
                  
                  The direct value of the green component associated with the color if the colorSpaceis.deviceRGB, or the computed value otherwise.DeclarationSwift public var green: Float { get set }
- 
                  
                  The direct value of the blue component associated with the color if the colorSpaceis.deviceRGB, or the computed value otherwise.DeclarationSwift public var blue: Float { get set }
- 
                  
                  The direct value of the cyan component associated with the color if the colorSpaceis.deviceCMYK, or the computed value otherwise.DeclarationSwift public var cyan: Float { get set }
- 
                  
                  The direct value of the magenta component associated with the color if the colorSpaceis.deviceCMYK, or the computed value otherwise.DeclarationSwift public var magenta: Float { get set }
- 
                  
                  The direct value of the yellow component associated with the color if the colorSpaceis.deviceCMYK, or the computed value otherwise.DeclarationSwift public var yellow: Float { get set }
- 
                  
                  The direct value of the black component associated with the color if the colorSpaceis.deviceCMYKor.deviceGray, or the computed value otherwise.DeclarationSwift public var black: Float { get set }
- 
                  
                  Creates a color with the RGB color model. For each parameter valid values are between 0 and 1. DeclarationSwift public init?(red: Float, green: Float, blue: Float, alpha: Float = 1)ParametersredThe red component of the color. greenThe green component of the color. blueThe blue component of the color. alphaThe alpha component of the color. Default value is 1. Return ValueThe color with the specified components, or nilif the values specified were invalid.
- 
                  
                  Creates a color with the CMYK color model. For each parameter valid values are between 0 and 1. DeclarationSwift public init?(cyan: Float, magenta: Float, yellow: Float, black: Float, alpha: Float = 1)ParameterscyanThe cyan component of the color. magentaThe magenta component of the color. yellowThe yellow component of the color. blackThe black component of the color. alphaThe alpha component of the color. Default value is 1. Return ValueThe color with the specified components, or nilif the values specified were invalid.
- 
                  
                  Creates a color with the gray shades color model. For each parameter valid values are between 0 and 1. DeclarationSwift public init?(gray: Float, alpha: Float = 1)ParametersgrayThe gray component of the color. alphaThe alpha component of the color. Default value is 1. Return ValueThe color with the specified components, or nilif the values specified were invalid.
- 
                  
                  Converts the color to the specified color space. Supported color spaces: DeclarationSwift public mutating func convert(to colorSpace: PDFColorSpace)ParameterscolorSpaceThe color space to convert the color to. 
- 
                  
                  Creates a new color by converting the current color to the specified color space. Supported color spaces: DeclarationSwift @inlinable public func converting(to colorSpace: PDFColorSpace) -> ColorParameterscolorSpaceThe color space of the new color. Return ValueThe new color with the specified color space. 
- 
                  
                  DeclarationSwift public var debugDescription: String { get }
- 
                  
                  DeclarationSwift public init(_colorLiteralRed red: Float, green: Float, blue: Float, alpha: Float)
 View on GitHub
View on GitHub Color Structure Reference
        Color Structure Reference