@@ -52,11 +52,10 @@ public class ColorPickerPlus: NSColorPicker, NSColorPickingCustom {
5252 Logger . error ( message: " Could not find nib named \( pickerNibName) " )
5353 fatalError ( )
5454 }
55-
55+
5656 radioHue. state = NSControl . StateValue. on
57-
58- colorGraphicsView. delegate = self
5957
58+ colorGraphicsView. delegate = self
6059 }
6160
6261 return pickerView
@@ -330,26 +329,31 @@ extension ColorPickerPlus: ChangeColorDelegate {
330329 let copyMenu = copyPopUp. menu!
331330
332331 copyMenu. addItem ( withTitle: " Copy " , action: nil , keyEquivalent: " " )
333- copyMenu. addItem ( withTitle: " HEX - # \( rgb. toHEX ( ) ) " , action: nil , keyEquivalent: " " )
334- copyMenu. addItem ( withTitle: " RGB - \( txtRed. stringValue) , \( txtGreen. stringValue) , \( txtBlue. stringValue) " , action: nil , keyEquivalent: " " )
335- copyMenu. addItem ( withTitle: " Float RGB - \( floatR) , \( floatG) , \( floatB) " , action: nil , keyEquivalent: " " )
336- copyMenu. addItem ( withTitle: " HSV - \( txtHue. stringValue) , \( txtSaturation. stringValue) , \( txtBrightness. stringValue) " , action: nil , keyEquivalent: " " )
332+
333+ copyMenu. addItem ( withTitle: " HEX - # \( rgb. toHEX ( ) ) " , action: nil , keyEquivalent: " c " )
334+
335+ copyMenu. addItem ( withTitle: " RGB - \( txtRed. stringValue) , \( txtGreen. stringValue) , \( txtBlue. stringValue) " , action: nil , keyEquivalent: " r " )
336+
337+ copyMenu. addItem ( withTitle: " Float RGB - \( floatR) , \( floatG) , \( floatB) " , action: nil , keyEquivalent: " R " )
338+
339+ copyMenu. addItem ( withTitle: " HSV - \( txtHue. stringValue) , \( txtSaturation. stringValue) , \( txtBrightness. stringValue) " , action: nil , keyEquivalent: " H " )
337340
338341 copyMenu. addItem ( NSMenuItem . separator ( ) )
339342
340- copyMenu. addItem ( withTitle: " Web RGB - rgb( \( txtRed. stringValue) , \( txtGreen. stringValue) , \( txtBlue. stringValue) ) " ,
341- action: nil , keyEquivalent: " " )
342- copyMenu. addItem ( withTitle: " Web RGBa - rgba( \( txtRed. stringValue) , \( txtGreen. stringValue) , \( txtBlue. stringValue) , \( txtAlpha. stringValue) ) " , action: nil , keyEquivalent: " " )
343- copyMenu. addItem ( withTitle: " Web HSL - hsl( \( txtHue. stringValue) , \( txtSaturation. stringValue) %, \( txtBrightness. stringValue) %) " , action: nil , keyEquivalent: " " )
344-
345- /*copyPopUp.addItems(withTitles: [
346- ,
347- ,
348- ,
349- ,
350- ,
351-
352- ])*/
343+ let webRGBItem = NSMenuItem ( title: " Web RGB - rgb( \( txtRed. stringValue) , \( txtGreen. stringValue) , \( txtBlue. stringValue) ) " , action: nil , keyEquivalent: " w " )
344+ webRGBItem. keyEquivalentModifierMask = [ . command, . option]
345+
346+ copyMenu. addItem ( webRGBItem)
347+
348+ let webRGBaItem = NSMenuItem ( title: " Web RGBa - rgba( \( txtRed. stringValue) , \( txtGreen. stringValue) , \( txtBlue. stringValue) , \( txtAlpha. stringValue) ) " , action: nil , keyEquivalent: " w " )
349+ webRGBaItem. keyEquivalentModifierMask = [ . command, . shift]
350+
351+ copyMenu. addItem ( webRGBaItem)
352+
353+ let webHSLItem = NSMenuItem ( title: " Web HSL - hsl( \( txtHue. stringValue) , \( txtSaturation. stringValue) %, \( txtBrightness. stringValue) %) " , action: nil , keyEquivalent: " w " )
354+ webHSLItem. keyEquivalentModifierMask = [ . command, . option, . shift]
355+
356+ copyMenu. addItem ( webHSLItem)
353357
354358 }
355359
0 commit comments