[squeak-dev] The Trunk: Graphics-mt.329.mcz

commits at source.squeak.org commits at source.squeak.org
Tue May 3 11:32:39 UTC 2016


Marcel Taeumel uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-mt.329.mcz

==================== Summary ====================

Name: Graphics-mt.329
Author: mt
Time: 3 May 2016, 1:32:06.694235 pm
UUID: f04b2de7-6533-e54c-a08f-8a9b4425aa22
Ancestors: Graphics-tfel.328

Fixes computation of dominant color in 8-bit color forms. There, we have to look up the own color table.

=============== Diff against Graphics-tfel.328 ===============

Item was added:
+ ----- Method: ColorForm>>dominantColor (in category 'analyzing') -----
+ dominantColor
+ 	"Overridden to consider color table"
+ 	
+ 	| tally max maxi |
+ 	tally := self tallyPixelValues.
+ 	max := maxi := 0.
+ 	tally withIndexDo: [:n :i | n > max ifTrue: [max := n. maxi := i]].
+ 	^ self colors at: maxi!



More information about the Squeak-dev mailing list