#FEATURE by cg draft
authorClaus Gittinger <cg@exept.de>
Fri, 24 Aug 2018 18:33:41 +0200
changeset 3592 149f58a2a522
parent 3591 ed5a8bd176e3
child 3593 c7c138eb0d86
#FEATURE by cg class: ImageEditor added: #makeSelectedColorSlightlyBrighter #makeSelectedColorSlightlyDarker class: ImageEditor class changed: #colorMapMenu
ImageEditor.st
--- a/ImageEditor.st	Fri Aug 24 18:33:26 2018 +0200
+++ b/ImageEditor.st	Fri Aug 24 18:33:41 2018 +0200
@@ -2792,6 +2792,7 @@
     "Do not manually edit this!! If it is corrupted,
      the MenuEditor may not be able to read the specification."
 
+
     "
      MenuEditor new openOnClass:ImageEditor andSelector:#colorMapMenu
      (Menu new fromLiteralArrayEncoding:(ImageEditor colorMapMenu)) startUp
@@ -2806,19 +2807,16 @@
             enabled: canAddColorToColormapHolder
             label: 'Add Color'
             itemValue: addColorToColormap
-            translateLabel: true
           )
          (MenuItem
             enabled: canAddColorToColormapHolder
             label: 'Add & Paste Color'
             itemValue: addPastedColorToColormap
-            translateLabel: true
           )
          (MenuItem
             enabled: canAddColorToColormapHolder
             label: 'Pick and Add Color...'
             itemValue: pickAndAddColorToColormap
-            translateLabel: true
           )
          (MenuItem
             label: '-'
@@ -2827,27 +2825,23 @@
             enabled: hasColormapAndSingleColorSelectedHolder
             label: 'Cut Color'
             itemValue: cutColorFromColormap
-            translateLabel: true
             isVisible: false
           )
          (MenuItem
             enabled: hasSingleColorSelectedHolder
             label: 'Copy Color'
             itemValue: copyColorFromColormap
-            translateLabel: true
             shortcutKey: Copy
           )
          (MenuItem
             enabled: hasColormapAndSingleWritableColorSelectedHolder
             label: 'Pick and Paste Color...'
             itemValue: pickAndPasteColor
-            translateLabel: true
           )
          (MenuItem
             enabled: canChangeColorInColormapHolder
             label: 'Paste Color'
             itemValue: pasteColorIntoColormap
-            translateLabel: true
             shortcutKey: Paste
           )
          (MenuItem
@@ -2857,31 +2851,39 @@
             enabled: hasColormapAndSingleWritableColorSelectedHolder
             label: 'Edit Color...'
             itemValue: editSelectedColor
-            translateLabel: true
+          )
+         (MenuItem
+            enabled: hasColormapAndColorSelected
+            label: 'Make Gray'
+            itemValue: makeSelectedColorGray
+          )
+         (MenuItem
+            enabled: hasColormapAndSingleWritableColorSelectedHolder
+            label: 'Color Shift...'
+            itemValue: makeSelectedColorShifted
+          )
+         (MenuItem
+            label: '-'
+          )
+         (MenuItem
+            enabled: hasColormapAndColorSelected
+            label: 'Slightly Brighter'
+            itemValue: makeSelectedColorSlightlyBrighter
+          )
+         (MenuItem
+            enabled: hasColormapAndColorSelected
+            label: 'Slightly Darker'
+            itemValue: makeSelectedColorSlightlyDarker
           )
          (MenuItem
             enabled: hasColormapAndColorSelected
             label: 'Brighter'
             itemValue: makeSelectedColorBrighter
-            translateLabel: true
           )
          (MenuItem
             enabled: hasColormapAndColorSelected
             label: 'Darker'
             itemValue: makeSelectedColorDarker
-            translateLabel: true
-          )
-         (MenuItem
-            enabled: hasColormapAndColorSelected
-            label: 'Make Gray'
-            itemValue: makeSelectedColorGray
-            translateLabel: true
-          )
-         (MenuItem
-            enabled: hasColormapAndSingleWritableColorSelectedHolder
-            label: 'Color Shift'
-            itemValue: makeSelectedColorShifted
-            translateLabel: true
           )
          (MenuItem
             label: '-'
@@ -2890,20 +2892,16 @@
             enabled: hasSingleColorSelectedHolder
             label: 'Inspect Color'
             itemValue: inspectColor
-            translateLabel: true
           )
          (MenuItem
             enabled: imageHasColormapHolder
             label: 'Inspect Colormap'
             itemValue: inspectColormap
-            translateLabel: true
           )
          )
         nil
         nil
       )
-
-    "Modified: / 08-10-2017 / 15:02:33 / cg"
 !
 
 menu
@@ -7456,6 +7454,14 @@
     "Modified: / 05-09-2017 / 09:03:47 / cg"
 !
 
+makeSelectedColorSlightlyBrighter
+    self processSelectedColorsWith:[:clr | clr slightlyLightened]
+!
+
+makeSelectedColorSlightlyDarker
+    self processSelectedColorsWith:[:clr | clr slightlyDarkened]
+!
+
 makeSlightlyBrighter
     self updateImageAfterDoing:#makeSlightlyBrighter.