also allow nearest-color mode for standard colormap.
authorClaus Gittinger <cg@exept.de>
Tue, 28 Jul 1998 22:34:35 +0200
changeset 921 a5aca21ea803
parent 920 bde5b9369ef8
child 922 0a5799408f54
also allow nearest-color mode for standard colormap.
ImageEditor.st
--- a/ImageEditor.st	Tue Jul 28 22:01:54 1998 +0200
+++ b/ImageEditor.st	Tue Jul 28 22:34:35 1998 +0200
@@ -1524,6 +1524,16 @@
             ]
         ] ifFalse:[
             "/ standard colormap
+            usedColors := oldImage usedColors.
+            (usedColors conform:[:clr | newColorMap includes:clr]) ifFalse:[
+                useNearest := Dialog 
+                                    confirmWithCancel:('Not all colors are present in the new colormap.\\Map missing ones to nearest (or map to black) ?'
+                                                       ) withCRs
+                                    labels:#('cancel' 'black' 'nearest').
+                useNearest isNil ifTrue:[
+                    ^ self   "/ cancel
+                ].
+            ].
         ].
 
         imageEditView makeUndo.
@@ -1608,7 +1618,7 @@
         ]
     ]
 
-    "Modified: / 28.7.1998 / 21:51:24 / cg"
+    "Modified: / 28.7.1998 / 22:29:53 / cg"
 !
 
 compressColorMap