Color.st
changeset 4202 a82c1cbb8d30
parent 4186 2ac5f5cb7944
child 4203 b306a1133946
--- a/Color.st	Mon Jul 12 16:05:36 2004 +0200
+++ b/Color.st	Wed Jul 14 19:16:27 2004 +0200
@@ -1322,6 +1322,21 @@
            scaledBlue:(blueFraction * MaxValue) rounded
 !
 
+r:r g:g b:b range:componentMax
+    "return a color from red, green and blue values;
+     the arguments, r, g and b are interpreted as values (0..componentMax)"
+
+    ^ here scaledRed:(r * MaxValue // componentMax)
+           scaledGreen:(g * MaxValue // componentMax)
+           scaledBlue:(b * MaxValue // componentMax)
+
+    "
+     (Color r:1023 g:0 b:0 range:1023) inspect
+     (Color r:1023 g:1023 b:1023 range:1023) inspect
+     (Color r:0 g:0 b:0 range:1023) inspect
+    "
+!
+
 showColors: colorList
         "Display the given collection of colors across the top of the Display."
 
@@ -5287,7 +5302,7 @@
 !Color class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/Color.st,v 1.189 2004-06-07 09:22:24 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/Color.st,v 1.190 2004-07-14 17:16:27 cg Exp $'
 ! !
 
 Color initialize!