colors of deep images
authorClaus Gittinger <cg@exept.de>
Wed, 03 Aug 2005 20:06:23 +0200
changeset 1927 c5068006116d
parent 1926 b3d2dab90f9b
child 1928 06c3681a79b3
colors of deep images
ImageEditor.st
--- a/ImageEditor.st	Tue Aug 02 17:41:38 2005 +0200
+++ b/ImageEditor.st	Wed Aug 03 20:06:23 2005 +0200
@@ -2900,7 +2900,7 @@
 findColorMapMode
     "finds the colorMapMode for a new image"
 
-    |image listOfColors colorMapModeKey drawColor1 drawColor2|
+    |image listOfColors colorMapModeKey drawColor1 drawColor2 someOrAllUsedColors|
 
     image := self image.
 
@@ -2916,7 +2916,9 @@
     image depth > 12 ifTrue:[
         listOfColors removeAll.
         image colorMap isEmptyOrNil ifTrue:[
-            listOfColors add:Color black; add:Color white.
+            someOrAllUsedColors := image usedColorsMax:10000.
+            listOfColors addAll:someOrAllUsedColors.
+            "/ listOfColors add:Color black; add:Color white.
         ] ifFalse:[
             listOfColors addAll:(image colorMap).
         ].