Color.st
changeset 8165 dec0d9176839
parent 8163 55b4897a908f
child 8171 17c30710ed4a
--- a/Color.st	Tue Sep 05 16:45:23 2017 +0200
+++ b/Color.st	Tue Sep 05 16:45:47 2017 +0200
@@ -4316,9 +4316,12 @@
     "Squeak compatibility:
      Answer this color mixed with the given color. The proportion, a number
      between 0.0 and 1.0, determines what what fraction of the receiver to
-     use in the mix. For example, 0.9 would yield a color close to the
-     receiver. This method uses RGB interpolation; HSV interpolation can lead
-     to surprises.  Mixes the alphas (for transparency) also."
+     use in the mix. 
+     For example, 1.0 yields the receiver, 0.0 yields aColor
+     and 0.9 would yield a color close to the receiver. 
+     This method uses RGB interpolation; 
+     HSV interpolation can lead to surprises.  
+     Mixes the alphas (for transparency) also."
 
     | frac1 frac2 |
 
@@ -4336,7 +4339,7 @@
     "
 
     "Created: / 06-06-2007 / 10:53:25 / cg"
-    "Modified (comment): / 03-02-2017 / 11:37:53 / cg"
+    "Modified (comment): / 05-09-2017 / 14:38:23 / cg"
 !
 
 bitPatternForDepth: depth
@@ -5419,7 +5422,7 @@
     deviceDepth := aDevice depth.
     (deviceVisual := aDevice visualType) == #TrueColor ifTrue:[
         deviceDepth >= 15 ifTrue:[
-            id := aDevice colorScaledRed:red scaledGreen:green scaledBlue:blue.
+            id := aDevice colorScaledRed:(red ? 0) scaledGreen:(green ? 0) scaledBlue:(blue ? 0).
             id notNil ifTrue:[
                 device isNil ifTrue:[
                     "/ receiver was not associated - do it now & return mySelf
@@ -5429,9 +5432,9 @@
                     ^ self
                 ].
                 newColor := self class basicNew
-                                    setScaledRed:red
-                                    scaledGreen:green
-                                    scaledBlue:blue
+                                    setScaledRed:(red ? 0)
+                                    scaledGreen:(green ? 0)
+                                    scaledBlue:(blue ? 0)
                                     device:aDevice.
                 newColor setColorId:id.
                 ^ newColor
@@ -5651,8 +5654,7 @@
     ^ newColor
 
     "Created: / 16-11-1995 / 20:16:42 / cg"
-    "Modified: / 08-09-1998 / 17:32:10 / cg"
-    "Modified (comment): / 13-02-2017 / 19:58:41 / cg"
+    "Modified: / 05-09-2017 / 12:20:54 / cg"
 ! !
 
 
@@ -5778,17 +5780,17 @@
     "create a new color from mixing amount of the receiver
      with the argument, aColor.
      Mixing is done by adding components (i.e. additive mixing)
-     (which is different from mixing colors on paper .. which is subtractive).
+     (which is different from mixing colors on paper, which is subtractive).
      With an amount of 1, this is the same as blendWith."
 
     red isNil ifTrue:[
-	^ aColor
+        ^ aColor
     ].
 
     ^ (self class)
-	scaledRed:((red * amount) + aColor scaledRed) // (1 + amount)
-	scaledGreen:((green * amount) + aColor scaledGreen) // (1 + amount)
-	scaledBlue:((blue * amount) + aColor scaledBlue) // (1 + amount)
+        scaledRed:((red * amount) + aColor scaledRed) // (1 + amount)
+        scaledGreen:((green * amount) + aColor scaledGreen) // (1 + amount)
+        scaledBlue:((blue * amount) + aColor scaledBlue) // (1 + amount)
 
     "
      (Color red) mixed:1 with:(Color yellow)
@@ -5803,7 +5805,8 @@
      (Color red) mixed:0.8 with:(Color black)
     "
 
-    "Modified: 10.2.1997 / 22:08:14 / cg"
+    "Modified: / 10-02-1997 / 22:08:14 / cg"
+    "Modified (comment): / 05-09-2017 / 14:35:40 / cg"
 !
 
 slightlyDarkened