     // MARK: - Private methods
     //
     // -----------------------------------------------------------------------------------------------------------------------
-    
-    private func parseColor(data data:[String:AnyObject], key:String, colors:[String:UIColor])->UIColor? {
-        if let colorName = data[key] as? String {
-            if let color = colors[colorName] {
-                return color
-            } else {
-                return UIColor(hexString: colorName)
-            }
-        } else {
-            return nil
-        }
-    }
-    
+
+	private func colorWithName(name:String?, orDefaultColor defaultColor:UIColor)->UIColor {
+		if let colorName = name, color = Styles.sharedStyles.colorNamed(colorName) {
+			return color
+		} else {
+			return defaultColor
+		}
+	}
+	
     private func parseFont(data data:[String:AnyObject], key:String)->UIFont? {
 		if let fontData = data[key] as? [String:AnyObject] {
 			let name = fontData["name"] as? String ?? self.font.fontName

        // Set properties from parent
        
        // - foreground colors
        self.foregroundColor = parentStyle.foregroundColor
        self.highlightedForegroundColor = parentStyle.highlightedForegroundColor
        self.selectedForegroundColor = parentStyle.selectedForegroundColor
        self.disabledForegroundColor = parentStyle.disabledForegroundColor
        
        // - background colors
        self.backgroundColor = parentStyle.backgroundColor
        self.highlightedBackgroundColor = parentStyle.highlightedBackgroundColor
        self.selectedBackgroundColor = parentStyle.selectedBackgroundColor
        self.disabledBackgroundColor = parentStyle.disabledBackgroundColor
        
        // - border style
        self.borderWidth = parentStyle.borderWidth
        self.borderColor = parentStyle.borderColor
        self.highlightedBorderColor = parentStyle.highlightedBorderColor
        self.selectedBorderColor = parentStyle.selectedBorderColor
        self.disabledBorderColor = parentStyle.disabledBorderColor
        self.borderStyle = parentStyle.borderStyle
        
		

public class Style {
	public let name:String
	
    // Border style
	public var borderWidth:CGFloat = 0.0
    public var borderStyle = UITextBorderStyle.RoundedRect
	
	// Image tinting
	public var tintImageWithForegroundColor:Bool = false
	
    // Cell separator style
    public var tableViewSeparatorStyle = UITableViewCellSeparatorStyle.SingleLine
	
	// Text
	public var font:UIFont = UIFont.systemFontOfSize(16.0)
	
	// Corners
	public var cornerRadius:CGFloat = 0.0
	
	
	// Foreground color names
	private (set) var foregroundColorName:String?
	private (set) var highlightedForegroundColorName:String?
	private (set) var selectedForegroundColorName:String?
	private (set) var disabledForegroundColorName:String?
	
	// Background color names
	private (set) var backgroundColorName:String?
	private (set) var highlightedBackgroundColorName:String?
	private (set) var selectedBackgroundColorName:String?
	private (set) var disabledBackgroundColorName:String?
	
	// Border color names
	private (set) var borderColorName:String?
	private (set) var highlightedBorderColorName:String?
	private (set) var selectedBorderColorName:String?
	private (set) var disabledBorderColorName:String?
	
	// Cell style color names
	private (set) var tableViewSeparatorColorName:String?
	
	
	// -----------------------------------------------------------------------------------------------------------------------
