         }
     }
 
+    /// Creates castling rights for `color`.
+    public init(color: Color) {
+        self = color.isWhite ? .white : .black
+    }
+
     #if swift(>=3)
 
     /// Creates a set of rights from a sequence.

        public static let all: [Right] = [.WhiteKingside, .WhiteQueenside, .BlackKingside, .BlackQueenside]

        #endif

        /// The color for `self`.
        public var color: Color {

    /// All castling rights.
    public static let all = CastlingRights(Right.all)

    /// White castling rights.
    public static let white = CastlingRights(Right.white)

    /// Black castling rights.
    public static let black = CastlingRights(Right.black)

    /// The rights.
    private var _rights: Set<Right>

