ImageEditor.st
changeset 2817 4577fb231f6f
parent 2814 ca2fc304931a
child 2820 301557d950e6
equal deleted inserted replaced
2816:1832d595db94 2817:4577fb231f6f
  5329 !
  5329 !
  5330 
  5330 
  5331 reduceNumberOfColors
  5331 reduceNumberOfColors
  5332     |s n anyChange img usedColors|
  5332     |s n anyChange img usedColors|
  5333 
  5333 
  5334     s := Dialog request:'Number of color bits to strip (1-7) ?'.
  5334     s := Dialog request:'Number of color bits to strip (1-7) ?' initialAnswer:3.
  5335     s size == 0 ifTrue:[^ self].
  5335     s size == 0 ifTrue:[^ self].
  5336 
  5336 
  5337     n := Integer readFrom:s onError:0.
  5337     n := Integer readFrom:s onError:0.
  5338     (n between:1 and:7) ifFalse:[
  5338     (n between:1 and:7) ifFalse:[
  5339         Dialog warn:'Image unchanged'.
  5339         Dialog warn:'Image unchanged'.
  5355             ] ifFalse:[
  5355             ] ifFalse:[
  5356                 Dialog information:(usedColors size printString , ' colors used.')
  5356                 Dialog information:(usedColors size printString , ' colors used.')
  5357             ]
  5357             ]
  5358         ]
  5358         ]
  5359     ].
  5359     ].
       
  5360 
       
  5361     "Modified: / 29-10-2010 / 18:08:01 / cg"
  5360 !
  5362 !
  5361 
  5363 
  5362 reduceNumberOfColors2
  5364 reduceNumberOfColors2
  5363     |s rndR rndG rndB usedColors image newImage|
  5365     |s rndR rndG rndB usedColors image newImage|
  5364 
  5366