         self.color = NSColor(colorCode: colorCode) ?? Theme.Style.invalidColor
     }
     
-}
-
-
-
-extension Theme.SelectionStyle: Decodable {
+    
+    func encode(to encoder: Encoder) throws {
+        
+        var container = encoder.container(keyedBy: CodingKeys.self)
+        
+        try container.encode(self.color.colorCode(type: .hex), forKey: .color)
+    }
+    
+}
+
+
+
+extension Theme.SelectionStyle: Codable {
     
     private enum CodingKeys: String, CodingKey {
         


// MARK: - Codable

extension Theme.Style: Decodable {
    
    fileprivate static let invalidColor = NSColor.gray.usingColorSpaceName(.calibratedRGB)!
    

        self.usesSystemSetting = try container.decodeIfPresent(Bool.self, forKey: .usesSystemSetting) ?? false
    }
    
    
    func encode(to encoder: Encoder) throws {
        
        var container = encoder.container(keyedBy: CodingKeys.self)
        
        try container.encode(self.color.colorCode(type: .hex), forKey: .color)
        try container.encode(true, forKey: .usesSystemSetting)
    }
    
}
