 }
 
 // return width, height and frequency info for corresponding displayID
-struct DisplayInfo {
+struct DisplayInfo:Hashable & Comparable & Equatable {
     static let MAX_SCALE = 10
     var width, height, scale, frequency:Int
+    var modeID:Int32
+    var modeRef:CGDisplayMode
+    //var colorDepth, resolution:Int
 
     init(displayID:CGDirectDisplayID, mode:CGDisplayMode) {
         width = mode.width
         height = mode.height
-        scale = mode.pixelWidth / mode.width;
+        scale = mode.pixelWidth / mode.width
+        modeID = mode.ioDisplayModeID
+        modeRef = mode
+        //colorDepth = Int( mode.BitsPerSample )
+        //resolution = Int( mode[kCGDisplayResolution] )
         
         frequency = Int( mode.refreshRate )
         if frequency == 0 {

    }

    func set(with setting: DisplayUserSetting) {
        if let mi = displayInfo.firstIndex(where: { setting ~= $0 }) {
            if mi != modeIndex { _set(mi) }
        } else {
            print("This mode is unavailable")
        }

// 1    width                   => 2
// 2    id, width
// 3    width, scale            => 6
// 4    width, height           =>
// 5    id, width, height
// 6    id, width, scale
// 7    id, width, height, scale
