         
         case read = "r"
         case write = "w"
-    }
-    
-    /// Models for color spaces.
-    public enum Model {
-        
-        /// An unknown color space model.
-        case unknown
-        
-        /// A monochrome color space model.
-        case monochrome
-        
-        /// An RGB color space model.
-        case rgb
-        
-        /// A CMYK color space model.
-        case cmyk
-        
-        /// A Lab color space model.
-        case lab
-        
-        /// A DeviceN color space model.
-        case deviceN
-        
-        /// An indexed color space model.
-        case indexed
-        
-        /// A pattern color space model.
-        case pattern
     }
 }
 

    
    // MARK: - Accessors
    
    public var name: String? {
        
        // FIXME: Is this correct?
        
        return self[cmsSigProfileDescriptionTag]
    }
    
    public var numberOfComponents: UInt {
        
        return UInt(cmsChannelsOf(cmsGetColorSpace(profile)))
    }
    
    // MARK: - Subscript


public extension ColorSpace {
    
    /// Device-independent RGB color space.
    static let genericRGB: ColorSpace =  ColorSpace(profile: cmsCreate_sRGBProfile())
    
    /// Grayscale color space with gamma 2.2 and a D65 white point.
    static let genericGray: ColorSpace = ColorSpace(gray: ((0.9504, 1.0000, 1.0888), (0,0,0)), gamma: 2.2)
}

// MARK: - Supporting Types

public extension ColorSpace {
    
    // CoreGraphics API
    
    /// Models for color spaces.
    public enum Model {
        
        /// An unknown color space model.
        case unknown
        
        /// A monochrome color space model.
        case monochrome
        
        /// An RGB color space model.
        case rgb
        
        /// A CMYK color space model.
        case cmyk
        
        /// A Lab color space model.
        case lab
        
        /// A DeviceN color space model.
        case deviceN
        
        /// An indexed color space model.
        case indexed
        
        /// A pattern color space model.
        case pattern
    }
    
    // LittleCMS API
    
    public enum ProfileInfo {
        
