[Pkg] The Trunk: Graphics-mt.379.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Jun 29 11:36:40 UTC 2017


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

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

Name: Graphics-mt.379
Author: mt
Time: 29 June 2017, 1:36:17.576613 pm
UUID: 150a8e87-27a9-e147-8ea5-ac166788fdb2
Ancestors: Graphics-mt.378

Fixed integration of color names with named crayon colors. Thanks to Ralph for pointing this out.

This works now: "Color banana name"

Note that I still do not follow up the scheme of having a class var for each named crayon color like the old named colors do. We can do this in the future if performance of named color access becomes an issue. Then, we could just opt for a caching dict and not a bunch of class vars. See MenuIcons for an example.

=============== Diff against Graphics-mt.378 ===============

Item was changed:
  ----- Method: Color class>>colorNames (in category 'other') -----
  colorNames
  	"Return a collection of color names."
  
+ 	^ ColorNames, self orderedCrayonColorNames!
- 	^ ColorNames!

Item was added:
+ ----- Method: Color class>>orderedCrayonColorNames (in category 'other') -----
+ orderedCrayonColorNames
+ 	
+ 	^ #(cantaloupe honeydew spindrift sky lavender carnation licorice snow salmon banana flora ice orchid bubblegum lead mercury tangerine lime seaFoam aqua grape strawberry tungsten silver maraschino lemon spring turquoise blueberry magenta iron magnesium mocha fern moss ocean eggplant maroon steel aluminum cayenne asparagus clover teal midnight plum tin nickel)!

Item was changed:
  ----- Method: Color class>>orderedCrayonColors (in category 'other') -----
  orderedCrayonColors
  	"self orderedCrayonColors explore."
  	
+ 	^ OrderedDictionary newFrom: (self orderedCrayonColorNames collect: [:ea | ea -> (self perform: ea)])!
- 	^ OrderedDictionary newFrom: (#(cantaloupe honeydew spindrift sky lavender carnation licorice snow salmon banana flora ice orchid bubblegum lead mercury tangerine lime seaFoam aqua grape strawberry tungsten silver maraschino lemon spring turquoise blueberry magenta iron magnesium mocha fern moss ocean eggplant maroon steel aluminum cayenne asparagus clover teal midnight plum tin nickel) collect: [:ea |
- 		ea -> (self perform: ea)])!

Item was changed:
  ----- Method: Color>>name (in category 'other') -----
  name
  	"Return this color's name, or nil if it has no name. Only returns a name if it exactly matches the named color."
  
+ 	^ self class colorNames detect: [ :name | (Color perform: name) = self ] ifNone: [ nil ]!
- 	^ColorNames detect: [ :name | (Color perform: name) = self ] ifNone: [ nil ]!



More information about the Packages mailing list