--- a/Color.st Wed Nov 19 16:27:48 2003 +0100
+++ b/Color.st Wed Nov 19 20:16:59 2003 +0100
@@ -1085,6 +1085,19 @@
scaledBlue:(b * MaxValue // 100)
!
+redShort:r greenShort:g blueShort:b
+ "return a color from red, green and blue short values;
+ the arguments, r, g and b are interpreted as unsigned short values (0..16rFFFF)"
+
+ ^ here scaledRed:(r * MaxValue // 16rFFFF)
+ scaledGreen:(g * MaxValue // 16rFFFF)
+ scaledBlue:(b * MaxValue // 16rFFFF)
+
+ "
+ (Color redShort:16rFFFF greenShort:0 blueShort:0) inspect
+ "
+!
+
rgbValue:rgb
"return a color from a 24bit RGB value;
The value is composed of r<<16 + g<<8 + b."
@@ -4898,6 +4911,14 @@
"do nothing here, for compatibility with Image/Form"
! !
+!Color methodsFor:'printing'!
+
+hex
+ ^(self red * 255) asInteger asCharacter hex,
+ (self green * 255) asInteger asCharacter hex,
+ (self blue * 255) asInteger asCharacter hex
+! !
+
!Color methodsFor:'printing & storing'!
encodingVectorFor:aspect
@@ -5265,7 +5286,7 @@
!Color class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/Color.st,v 1.185 2003-09-25 14:42:10 tm Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/Color.st,v 1.186 2003-11-19 19:16:59 cg Exp $'
! !
Color initialize!