--- a/ColorMenu.st Sat May 08 20:13:33 1999 +0200
+++ b/ColorMenu.st Sat May 08 23:48:05 1999 +0200
@@ -130,10 +130,12 @@
colorMenu:labelAreColored value:aValue
"returns a color menu
"
- |menu fgOrBg mainCol style|
+ |menu fgOrBg mainCol style e|
menu := Menu new.
- style := labelAreColored == false ifTrue:[#backgroundColor] ifFalse:[#color].
+ style := (labelAreColored == false)
+ ifTrue:[#backgroundColor]
+ ifFalse:[#color].
self colorDefinition do:[:aSlice|
|size colOp color item smenu|
@@ -159,7 +161,17 @@
colOp keywords keysAndValuesDo:[:i :c| label := label, ' ', c, ' ' , (el at:i) printString ].
]
].
- sitem := MenuItem labeled:(Text string:('Color ', label) emphasis:(style->color)).
+ e := style->color.
+ style == #backgroundColor ifTrue:[
+ color brightness < 0.5 ifTrue:[
+ e := Array with:e
+ with:(#color->Color white)
+ ]
+ ].
+ sitem := MenuItem
+ labeled:(Text
+ string:('Color ', label)
+ emphasis:e).
sitem argument:color.
sitem value:aValue.
smenu addItem:sitem.
@@ -631,5 +643,5 @@
!ColorMenu class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg2/ColorMenu.st,v 1.17 1998-09-08 11:10:04 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg2/ColorMenu.st,v 1.18 1999-05-08 21:48:05 cg Exp $'
! !