[squeak-dev] The Inbox: Graphics-ct.441.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Sep 30 19:23:53 UTC 2020


Christoph Thiede uploaded a new version of Graphics to project The Inbox:
http://source.squeak.org/inbox/Graphics-ct.441.mcz

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

Name: Graphics-ct.441
Author: ct
Time: 30 September 2020, 9:23:41.380807 pm
UUID: 7b1f1c65-2eca-4442-a0da-88e6975377f2
Ancestors: Graphics-pre.439

Proposal: Isolate alpha channel when printing a named color. This allows it to reuse the color name even for translucent color.

Example:
	(Color red alpha: 0.4) printString
Output (new):
	 'Color red alpha: 0.4'
Output (old):
	'(TranslucentColor r: 1 g: 0.0 b: 0.0 alpha: 0.4)'

=============== Diff against Graphics-pre.439 ===============

Item was changed:
  ----- Method: Color>>printOn: (in category 'printing') -----
  printOn: aStream
+ 
  	| name |
+ 	name := self asNontranslucentColor name.
+ 	name ifNil: [^ self storeOn: aStream].
+ 	
+ 	aStream
+ 		nextPutAll: 'Color ';
+ 		nextPutAll: name.
+ 	self isTranslucent ifTrue: [
+ 		aStream
+ 			nextPutAll: ' alpha: ';
+ 			print: self alpha maxDecimalPlaces: 3].!
- 	(name := self name) ifNotNil:
- 		[^ aStream
- 			nextPutAll: 'Color ';
- 			nextPutAll: name].
- 	self storeOn: aStream.
- !



More information about the Squeak-dev mailing list