Color.st
changeset 1856 50a92c932fbd
parent 1855 dc59c0c86b52
child 1859 b483006c48f5
--- a/Color.st	Mon Aug 11 17:18:53 1997 +0200
+++ b/Color.st	Wed Aug 13 15:26:32 1997 +0200
@@ -3633,6 +3633,23 @@
     "Modified: 24.2.1997 / 18:23:20 / cg"
 !
 
+exactOrNearestOn:aDevice
+    "get a device color for the receiver, which is either exact
+     or the nearest, but never dithered.
+     This can be used for viewBackgrounds, where the exact greyLevel
+     does not matter, but a dithered color is not wanted."
+
+    |deviceColor|
+
+    deviceColor := self exactOn:aDevice.
+    deviceColor isNil ifTrue:[
+        deviceColor := self nearestOn:aDevice
+    ].
+    ^ deviceColor
+
+    "Created: 13.8.1997 / 15:25:48 / cg"
+!
+
 nearestOn:aDevice 
     "create a new Color representing the same color as myself on aDevice; 
      if one already exists, return the one. If no exact match is found,
@@ -4312,6 +4329,6 @@
 !Color class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/Color.st,v 1.99 1997-08-11 15:18:53 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/Color.st,v 1.100 1997-08-13 13:26:32 cg Exp $'
 ! !
 Color initialize!