Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Renamed contrastingColor method in contrastingBlackAndWhiteColor
  • Loading branch information
apierr committed Apr 26, 2019
1 parent 9ca8696 commit ef962c0
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/Colors/Color.class.st
Expand Up @@ -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].
Expand Down
2 changes: 1 addition & 1 deletion src/Morphic-Base/StringMorph.class.st
Expand Up @@ -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 }
Expand Down
2 changes: 1 addition & 1 deletion src/Morphic-Widgets-Basic/FuzzyLabelMorph.class.st
Expand Up @@ -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].
Expand Down
6 changes: 3 additions & 3 deletions src/Morphic-Widgets-Basic/PluggableButtonMorph.class.st
Expand Up @@ -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
]
Expand Down Expand Up @@ -499,7 +499,7 @@ PluggableButtonMorph >> focusBounds [
PluggableButtonMorph >> focusColor [
"Answer the keyboard focus indication color."

^self color contrastingColor
^self color contrastingBlackAndWhiteColor
]

{ #category : #accessing }
Expand Down
2 changes: 1 addition & 1 deletion src/Morphic-Widgets-Basic/SimpleButtonMorph.class.st
Expand Up @@ -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
]
Expand Down
2 changes: 1 addition & 1 deletion src/Polymorph-Widgets/ExpanderTitleMorph.class.st
Expand Up @@ -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
]

Expand Down
2 changes: 1 addition & 1 deletion src/Polymorph-Widgets/Morph.extension.st
Expand Up @@ -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' }
Expand Down
4 changes: 2 additions & 2 deletions src/Polymorph-Widgets/ThemeSettings.class.st
Expand Up @@ -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 }
Expand Down Expand Up @@ -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 }
Expand Down
4 changes: 2 additions & 2 deletions src/Polymorph-Widgets/UITheme.class.st
Expand Up @@ -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]
]

Expand All @@ -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]
]

Expand Down
2 changes: 1 addition & 1 deletion src/Rubric/RubLineNumberDisplayer.class.st
Expand Up @@ -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 }
Expand Down
2 changes: 1 addition & 1 deletion src/Rubric/RubTextSegmentIconBox.class.st
Expand Up @@ -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 }
Expand Down
2 changes: 1 addition & 1 deletion src/Rubric/RubTextSegmentIconDisplayer.class.st
Expand Up @@ -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 }
Expand Down

0 comments on commit ef962c0

Please sign in to comment.