#OTHER
authorClaus Gittinger <cg@exept.de>
Tue, 22 Sep 2015 18:12:36 +0200
changeset 6924 295e6d594ca0
parent 6923 984ae9de4fc5
child 6926 d04d6d93b921
#OTHER class: ViewStyle changed: #colorAt:default:
ViewStyle.st
--- a/ViewStyle.st	Tue Sep 22 17:56:05 2015 +0200
+++ b/ViewStyle.st	Tue Sep 22 18:12:36 2015 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 1993 by Claus Gittinger
 	      All Rights Reserved
@@ -174,7 +176,19 @@
     "retrieve a color resource - also aquire a device color
      to avoid repeated color allocations later"
 
-    ^ self deviceResourceAt:aKey default:default
+    |value device deviceColor|
+
+    device := Display.
+
+    value := self at:aKey default:default.
+    value isInteger ifTrue:[
+        value := Color rgbValue:value
+    ].
+    (value notNil and:[device notNil]) ifTrue:[
+        deviceColor := value onDevice:device.
+        deviceColor notNil ifTrue:[^ deviceColor].
+    ].
+    ^ value
 !
 
 deviceResourceAt:aKey default:default