--- a/FixedPaletteWithAlpha.st Mon Mar 07 00:49:52 2016 +0100
+++ b/FixedPaletteWithAlpha.st Mon Mar 07 01:55:55 2016 +0100
@@ -1,3 +1,14 @@
+"
+ COPYRIGHT (c) 2016 by Claus Gittinger
+ All Rights Reserved
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice. This software may not
+ be provided or otherwise made available to, or used by, any
+ other person. No title to or ownership of the software is
+ hereby transferred.
+"
"{ Package: 'stx:libview' }"
"{ NameSpace: Smalltalk }"
@@ -9,6 +20,21 @@
category:'Graphics-Images-Support'
!
+!FixedPaletteWithAlpha class methodsFor:'documentation'!
+
+copyright
+"
+ COPYRIGHT (c) 2016 by Claus Gittinger
+ All Rights Reserved
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice. This software may not
+ be provided or otherwise made available to, or used by, any
+ other person. No title to or ownership of the software is
+ hereby transferred.
+"
+! !
!FixedPaletteWithAlpha methodsFor:'accessing'!
@@ -19,6 +45,15 @@
!FixedPaletteWithAlpha methodsFor:'printing & storing'!
+size
+ "return the number of (simulated) colors in this colormap"
+
+ ^ ((alphaMask bitShift:alphaShift)
+ + (redMask bitShift:redShift)
+ + (greenMask bitShift:greenShift)
+ + (blueMask bitShift:blueShift)) + 1
+!
+
storeInstVarsOn:aStream
super storeInstVarsOn:aStream.
aStream nextPutAll:' alphaShift:'. alphaShift storeOn:aStream.