diff --git a/src/Colors/Color.class.st b/src/Colors/Color.class.st index 82f78acfc67..5b0fb7e006c 100644 --- a/src/Colors/Color.class.st +++ b/src/Colors/Color.class.st @@ -1249,7 +1249,7 @@ Color >> colorForInsets [ ] { #category : #conversions } -Color >> contrastingColor [ +Color >> contrastingBlackAndWhiteColor [ "Answer black or white depending on the luminance." self isTransparent ifTrue: [ ^ self class black]. diff --git a/src/Morphic-Base/StringMorph.class.st b/src/Morphic-Base/StringMorph.class.st index da569cc63f7..66a4fce6e22 100644 --- a/src/Morphic-Base/StringMorph.class.st +++ b/src/Morphic-Base/StringMorph.class.st @@ -193,7 +193,7 @@ StringMorph >> contentsClipped: aString [ { #category : #accessing } StringMorph >> contrastingBackgroundColor [ "sets the backgroundColor to either black or white, which ever makes the string simplest to read" - backgroundColor := self color contrastingColor + backgroundColor := self color contrastingBlackAndWhiteColor ] { #category : #initialization } diff --git a/src/Morphic-Widgets-Basic/FuzzyLabelMorph.class.st b/src/Morphic-Widgets-Basic/FuzzyLabelMorph.class.st index 8fdfe9d8601..3c1305d4e1d 100644 --- a/src/Morphic-Widgets-Basic/FuzzyLabelMorph.class.st +++ b/src/Morphic-Widgets-Basic/FuzzyLabelMorph.class.st @@ -36,7 +36,7 @@ FuzzyLabelMorph >> drawOn: aCanvas [ ifTrue: [self color] ifFalse: [pc twiceDarker]. fuzzColor := self enabled - ifTrue: [labelColor twiceDarker darker contrastingColor alpha: self + ifTrue: [labelColor twiceDarker darker contrastingBlackAndWhiteColor alpha: self alpha] ifFalse: [Color transparent]. aCanvas depth < 8 ifTrue: [fuzzColor := Color transparent alpha: 0.001]. diff --git a/src/Morphic-Widgets-Basic/PluggableButtonMorph.class.st b/src/Morphic-Widgets-Basic/PluggableButtonMorph.class.st index 49323a9f3d7..6766d77f78e 100644 --- a/src/Morphic-Widgets-Basic/PluggableButtonMorph.class.st +++ b/src/Morphic-Widgets-Basic/PluggableButtonMorph.class.st @@ -355,8 +355,8 @@ PluggableButtonMorph >> changed [ or: [label isMorph]) ifFalse: [ pc := self normalColor. lc := self enabled - ifTrue: [pc contrastingColor] - ifFalse: [pc contrastingColor muchDarker]. + ifTrue: [pc contrastingBlackAndWhiteColor] + ifFalse: [pc contrastingBlackAndWhiteColor muchDarker]. self labelMorph color: lc]]. super changed ] @@ -499,7 +499,7 @@ PluggableButtonMorph >> focusBounds [ PluggableButtonMorph >> focusColor [ "Answer the keyboard focus indication color." - ^self color contrastingColor + ^self color contrastingBlackAndWhiteColor ] { #category : #accessing } diff --git a/src/Morphic-Widgets-Basic/SimpleButtonMorph.class.st b/src/Morphic-Widgets-Basic/SimpleButtonMorph.class.st index 80d20f2cad8..41ae2e669e6 100644 --- a/src/Morphic-Widgets-Basic/SimpleButtonMorph.class.st +++ b/src/Morphic-Widgets-Basic/SimpleButtonMorph.class.st @@ -380,7 +380,7 @@ SimpleButtonMorph >> themeChanged [ cornerStyle: (self theme buttonCornerStyleIn: self window); fillStyle: self themedFillStyle. - label ifNotNil: [ label color: self fillStyle asColor contrastingColor ]. + label ifNotNil: [ label color: self fillStyle asColor contrastingBlackAndWhiteColor ]. super themeChanged ] diff --git a/src/Polymorph-Widgets/ExpanderTitleMorph.class.st b/src/Polymorph-Widgets/ExpanderTitleMorph.class.st index 441d5dc0371..27ba0250cbb 100644 --- a/src/Polymorph-Widgets/ExpanderTitleMorph.class.st +++ b/src/Polymorph-Widgets/ExpanderTitleMorph.class.st @@ -22,7 +22,7 @@ ExpanderTitleMorph >> adoptPaneColor: paneColor [ self fillStyle: self normalFillStyle. self borderStyle baseColor: paneColor twiceDarker. self buttonMorph cornerStyle: self cornerStyle. - self labelMorph color: paneColor contrastingColor. + self labelMorph color: paneColor contrastingBlackAndWhiteColor. self changed: #expandLabel ] diff --git a/src/Polymorph-Widgets/Morph.extension.st b/src/Polymorph-Widgets/Morph.extension.st index 5e135138a74..3ca65eac984 100644 --- a/src/Polymorph-Widgets/Morph.extension.st +++ b/src/Polymorph-Widgets/Morph.extension.st @@ -55,7 +55,7 @@ Morph >> focusChanged [ Morph >> focusColor [ "Answer the keyboard focus indication color." - ^self borderStyle color contrastingColor + ^self borderStyle color contrastingBlackAndWhiteColor ] { #category : #'*Polymorph-Widgets' } diff --git a/src/Polymorph-Widgets/ThemeSettings.class.st b/src/Polymorph-Widgets/ThemeSettings.class.st index 2ec0d21abb0..1476c3270aa 100644 --- a/src/Polymorph-Widgets/ThemeSettings.class.st +++ b/src/Polymorph-Widgets/ThemeSettings.class.st @@ -240,7 +240,7 @@ ThemeSettings >> findReplaceSelectionTextColor [ "Answer the value of the selectionTextColor for find/replace" ^ findReplaceSelectionTextColor - ifNil: [ self findReplaceSelectionColor contrastingColor ] + ifNil: [ self findReplaceSelectionColor contrastingBlackAndWhiteColor ] ] { #category : #accessing } @@ -511,7 +511,7 @@ ThemeSettings >> secondarySelectionTextColor [ "Answer the value of selectionTextColor" ^ secondarySelectionTextColor - ifNil: [ Smalltalk ui theme secondarySelectionColor contrastingColor ] + ifNil: [ Smalltalk ui theme secondarySelectionColor contrastingBlackAndWhiteColor ] ] { #category : #accessing } diff --git a/src/Polymorph-Widgets/UITheme.class.st b/src/Polymorph-Widgets/UITheme.class.st index b598b4fd04c..9d0518f7571 100644 --- a/src/Polymorph-Widgets/UITheme.class.st +++ b/src/Polymorph-Widgets/UITheme.class.st @@ -2616,7 +2616,7 @@ UITheme >> menuItemDisabledTextColorFor: aMenuItem [ "Answer the color to use for disabled menu item text." ^((aMenuItem color luminance - aMenuItem owner color luminance) abs < 0.3) - ifTrue: [aMenuItem owner color contrastingColor muchDarker] + ifTrue: [aMenuItem owner color contrastingBlackAndWhiteColor muchDarker] ifFalse: [aMenuItem owner color muchDarker] ] @@ -2638,7 +2638,7 @@ UITheme >> menuItemNormalTextColorFor: aMenuItem [ "Answer the color to use for normal menu item text." ^((aMenuItem color luminance - aMenuItem owner paneColor luminance) abs < 0.3) - ifTrue: [aMenuItem owner paneColor contrastingColor] + ifTrue: [aMenuItem owner paneColor contrastingBlackAndWhiteColor] ifFalse: [aMenuItem color] ] diff --git a/src/Rubric/RubLineNumberDisplayer.class.st b/src/Rubric/RubLineNumberDisplayer.class.st index fb7bff80b48..d5c9aebe821 100644 --- a/src/Rubric/RubLineNumberDisplayer.class.st +++ b/src/Rubric/RubLineNumberDisplayer.class.st @@ -240,7 +240,7 @@ RubLineNumberDisplayer >> verticalSeparatorBounds [ { #category : #accessing } RubLineNumberDisplayer >> verticalSeparatorColor [ - ^ (self textArea backgroundColor contrastingColor ) alpha: 0.3 + ^ (self textArea backgroundColor contrastingBlackAndWhiteColor ) alpha: 0.3 ] { #category : #accessing } diff --git a/src/Rubric/RubTextSegmentIconBox.class.st b/src/Rubric/RubTextSegmentIconBox.class.st index afb45af0528..e89262a7b2e 100644 --- a/src/Rubric/RubTextSegmentIconBox.class.st +++ b/src/Rubric/RubTextSegmentIconBox.class.st @@ -62,7 +62,7 @@ RubTextSegmentIconBox >> verticalSeparatorBounds [ { #category : #accessing } RubTextSegmentIconBox >> verticalSeparatorColor [ - ^ (self textArea backgroundColor contrastingColor ) alpha: 0.3 + ^ (self textArea backgroundColor contrastingBlackAndWhiteColor ) alpha: 0.3 ] { #category : #accessing } diff --git a/src/Rubric/RubTextSegmentIconDisplayer.class.st b/src/Rubric/RubTextSegmentIconDisplayer.class.st index 945752d25da..ff959785414 100644 --- a/src/Rubric/RubTextSegmentIconDisplayer.class.st +++ b/src/Rubric/RubTextSegmentIconDisplayer.class.st @@ -232,7 +232,7 @@ RubTextSegmentIconDisplayer >> verticalSeparatorBounds [ { #category : #accessing } RubTextSegmentIconDisplayer >> verticalSeparatorColor [ - ^ (self textArea backgroundColor contrastingColor ) alpha: 0.3 + ^ (self textArea backgroundColor contrastingBlackAndWhiteColor ) alpha: 0.3 ] { #category : #accessing }