--- a/Color.st Fri Jun 25 17:01:14 1999 +0200
+++ b/Color.st Fri Jun 25 17:51:41 1999 +0200
@@ -3739,13 +3739,24 @@
fromLiteralArrayEncoding:encoding
"read my values from an encoding.
- The encoding is supposed to be of the form:
+ The encoding is supposed to be either of the form:
(#Color redPart greenPart bluePart)
+ or:
+ (#Color constantColorSymbol)
This is the reverse operation to #literalArrayEncoding."
- red := ((encoding at:2) / 100.0 * MaxValue) rounded.
- green := ((encoding at:3) / 100.0 * MaxValue) rounded.
- blue := ((encoding at:4) / 100.0 * MaxValue) rounded.
+ |clr|
+
+ encoding size == 2 ifTrue:[
+ clr := Color perform:(encoding at:2).
+ red := clr red.
+ green := clr green.
+ blue := clr blue
+ ] ifFalse:[
+ red := ((encoding at:2) / 100.0 * MaxValue) rounded.
+ green := ((encoding at:3) / 100.0 * MaxValue) rounded.
+ blue := ((encoding at:4) / 100.0 * MaxValue) rounded.
+ ].
"
Color new fromLiteralArrayEncoding:#(#Color 50 25 25)
@@ -4610,6 +4621,6 @@
!Color class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/Color.st,v 1.124 1999-02-15 23:20:15 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/Color.st,v 1.125 1999-06-25 15:51:41 cg Exp $'
! !
Color initialize!