Color.st
changeset 3399 02a4018f9549
parent 3396 18f99e9fc5ec
child 3427 609caad9766c
--- a/Color.st	Fri Jan 12 13:45:26 2001 +0100
+++ b/Color.st	Fri Jan 12 14:39:38 2001 +0100
@@ -925,7 +925,7 @@
      If aString is not a valid color name, 
      return the result from evaluating errorBlock."
 
-    |triple r g b|
+    |triple r g b currScreen|
 
     triple := StandardColorValues at:colorName asString ifAbsent:nil.
     triple notNil ifTrue:[
@@ -933,15 +933,19 @@
         g := triple at:2.
         b := triple at:3.
     ] ifFalse:[
-        "/ ask display ...
-
-        Screen current
-            getScaledRGBFromName:colorName 
-            into:[:rr :gg :bb |
-                r := rr.
-                g := gg.
-                b := bb
-            ].
+        "/ ask display (if there is one) ...
+
+	(Screen notNil 
+	and:[ (currScreen := Screen current) notNil])
+	ifTrue:[
+            currScreen
+                getScaledRGBFromName:colorName 
+                into:[:rr :gg :bb |
+                    r := rr.
+                    g := gg.
+                    b := bb
+                ].
+	]
     ].
     r notNil ifTrue:[
         ^ here scaledRed:r scaledGreen:g scaledBlue:b
@@ -5157,6 +5161,6 @@
 !Color class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/Color.st,v 1.162 2001-01-08 17:32:28 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/Color.st,v 1.163 2001-01-12 13:39:38 cg Exp $'
 ! !
 Color initialize!