Skip to content

Commit

Permalink
1) color literals are now in all caps 2) changed the way color litera…
Browse files Browse the repository at this point in the history
…ls are noted/created 3) changing how color regex is created in LiveCodeLab
  • Loading branch information
davidedc committed Jun 24, 2020
1 parent c4a73e1 commit 8b27457
Show file tree
Hide file tree
Showing 53 changed files with 247 additions and 242 deletions.
2 changes: 1 addition & 1 deletion src/BasementOpenerWdgt.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class BasementOpenerWdgt extends IconicDesktopSystemLinkWdgt

color_hover: new Color 90, 90, 90
color_pressed: new Color 128, 128, 128
color_normal: Color.black
color_normal: Color.BLACK

_acceptsDrops: true

Expand Down
2 changes: 1 addition & 1 deletion src/CodeInjectingSimpleRectangularButtonMorph.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class CodeInjectingSimpleRectangularButtonMorph extends SimpleRectangularButtonM

constructor: (@wdgtToBeNotifiedForNewCode, @wdgtWhereToInject, face) ->
super true, @, 'injectCodeIntoTarget', face
@strokeColor = Color.black
@strokeColor = Color.BLACK
@setColor new Color 150, 150, 150
@toolTipMessage = face.toolTipMessage

Expand Down
6 changes: 3 additions & 3 deletions src/CodePromptMorph.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class CodePromptMorph extends Widget
@tempPromptEntryField = new SimplePlainTextScrollPanelWdgt @defaultContents, false, 5
@tempPromptEntryField.disableDrops()
@tempPromptEntryField.contents.disableDrops()
@tempPromptEntryField.color = Color.white
@tempPromptEntryField.color = Color.WHITE
@tempPromptEntryField.addModifiedContentIndicator()

# register this wdgt as one to be notified when the text
Expand All @@ -44,7 +44,7 @@ class CodePromptMorph extends Widget
@tempPromptEntryField.widgetToBeNotifiedOfTextModificationChange = @

@textMorph = @tempPromptEntryField.textWdgt
@textMorph.backgroundColor = Color.transparent
@textMorph.backgroundColor = Color.TRANSPARENT
@textMorph.setFontName nil, nil, @textMorph.monoFontStack
@textMorph.isEditable = true
@textMorph.enableSelecting()
Expand Down Expand Up @@ -73,7 +73,7 @@ class CodePromptMorph extends Widget
@invalidateLayout()

textContentModified: ->
@saveTextWdgt.setColor Color.black
@saveTextWdgt.setColor Color.BLACK

textContentUnmodified: ->
@saveTextWdgt.setColor new Color 200, 200, 200
Expand Down
4 changes: 2 additions & 2 deletions src/ColorPickerMorph.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ class ColorPickerMorph extends Widget
colorPalette: nil
grayPalette: nil

constructor: ( @choice = Color.white ) ->
constructor: ( @choice = Color.WHITE ) ->
super()
@appearance = new RectangularAppearance @
@color = Color.white
@color = Color.WHITE
@rawSetExtent new Point 80, 80
@buildSubmorphs()

Expand Down
4 changes: 2 additions & 2 deletions src/EmptyButtonMorph.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class EmptyButtonMorph extends Widget


# overrides to superclass
color: Color.white
color: Color.WHITE

constructor: (
@ifInsidePopUpThenClosesUnpinnedPopUpsWhenClicked = true,
Expand All @@ -58,7 +58,7 @@ class EmptyButtonMorph extends Widget
@defaultRejectDrags = true

#@color = new Color 255, 152, 152
#@color = Color.white
#@color = Color.WHITE
if @faceMorph?

if (typeof @faceMorph) == "string"
Expand Down
4 changes: 2 additions & 2 deletions src/ErrorsLogViewerMorph.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ class ErrorsLogViewerMorph extends Widget
@tempPromptEntryField = new SimplePlainTextScrollPanelWdgt @defaultContents, false, 5
@tempPromptEntryField.disableDrops()
@tempPromptEntryField.contents.disableDrops()
@tempPromptEntryField.color = Color.white
@tempPromptEntryField.color = Color.WHITE

@textMorph = @tempPromptEntryField.textWdgt
@textMorph.backgroundColor = Color.transparent
@textMorph.backgroundColor = Color.TRANSPARENT
@textMorph.setFontName nil, nil, @textMorph.monoFontStack
@textMorph.isEditable = true
@textMorph.enableSelecting()
Expand Down
4 changes: 2 additions & 2 deletions src/HandleMorph.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class HandleMorph extends Widget
else
@inset = new Point minimumPadding, minimumPadding
super()
@color = Color.white
@color = Color.WHITE
@noticesTransparentClick = true
size = WorldMorph.preferencesAndSettings.handleSize
@silentRawSetExtent new Point size, size
Expand Down Expand Up @@ -147,7 +147,7 @@ class HandleMorph extends Widget
if @state == @STATE_NORMAL
@handleMorphRenderingHelper aContext, @color, new Color 150, 150, 150
if @state == @STATE_HIGHLIGHTED
@handleMorphRenderingHelper aContext, Color.white, new Color 200, 200, 255
@handleMorphRenderingHelper aContext, Color.WHITE, new Color 200, 200, 255

aContext.restore()

Expand Down
2 changes: 1 addition & 1 deletion src/IconicDesktopSystemShortcutWdgt.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class IconicDesktopSystemShortcutWdgt extends IconicDesktopSystemLinkWdgt

color_hover: new Color 90, 90, 90
color_pressed: new Color 128, 128, 128
color_normal: Color.black
color_normal: Color.BLACK

reactToDropOf: (droppedWidget) ->

Expand Down
6 changes: 3 additions & 3 deletions src/LayoutElementAdderOrDropletMorph.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class LayoutElementAdderOrDropletMorph extends Widget

constructor: ->
super()
@setColor Color.black
@setColor Color.BLACK
@setMinAndMaxBoundsAndSpreadability (new Point 15,15) , (new Point 15,15), LayoutSpec.SPREADABILITY_HANDLES

# This method only paints this very morph's "image",
Expand Down Expand Up @@ -40,7 +40,7 @@ class LayoutElementAdderOrDropletMorph extends Widget
morphPosition = @position()
aContext.translate morphPosition.x, morphPosition.y

@spacerMorphRenderingHelper aContext, Color.white, new Color 200, 200, 255
@spacerMorphRenderingHelper aContext, Color.WHITE, new Color 200, 200, 255

aContext.restore()

Expand Down Expand Up @@ -144,6 +144,6 @@ class LayoutElementAdderOrDropletMorph extends Widget
@setColor new Color 100, 100, 100

mouseLeave: ->
@setColor Color.black
@setColor Color.BLACK


4 changes: 2 additions & 2 deletions src/LayoutSpacerMorph.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class LayoutSpacerMorph extends Widget

constructor: (spacerWeight = 1) ->
super()
@setColor Color.black
@setColor Color.BLACK
@setMinAndMaxBoundsAndSpreadability (new Point 0,0) , (new Point 1,1), spacerWeight * LayoutSpec.SPREADABILITY_SPACERS
@minimumExtent = new Point 0,0

Expand Down Expand Up @@ -57,7 +57,7 @@ class LayoutSpacerMorph extends Widget
morphPosition = @position()
aContext.translate morphPosition.x, morphPosition.y

@spacerMorphRenderingHelper aContext, Color.white, new Color 200, 200, 255
@spacerMorphRenderingHelper aContext, Color.WHITE, new Color 200, 200, 255

aContext.restore()

Expand Down
2 changes: 1 addition & 1 deletion src/ListMorph.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class ListMorph extends ScrollPanelWdgt
#debugger
super()
@contents.disableDrops()
@color = Color.white
@color = Color.WHITE
@buildAndConnectChildren() # builds the list contents
# it's important to leave the step as the default noOperation
# instead of nil because the scrollbars (inherited from ScrollPanel)
Expand Down
2 changes: 1 addition & 1 deletion src/MouseSensorMorph.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class MouseSensorMorph extends BoxMorph

constructor: (@cornerRadius = 4) ->
super
@color = Color.white
@color = Color.WHITE
@isTouched = false
@upStep = 0.05
@downStep = 0.02
Expand Down
4 changes: 2 additions & 2 deletions src/PreferencesAndSettings.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class PreferencesAndSettings
@menuHeaderBold = true # false
@menuStrokeColor = new Color 210, 210, 210 # new Color 186, 186, 186
@menuBackgroundColor = new Color 249, 249, 249 # new Color 244, 244, 244
@menuButtonsLabelColor = Color.black # new Color 50, 50, 50
@menuButtonsLabelColor = Color.BLACK # new Color 50, 50, 50

@externalWindowBarBackgroundColor = new Color 125, 125, 125
@externalWindowBarStrokeColor = new Color 100,100,100
Expand All @@ -107,7 +107,7 @@ class PreferencesAndSettings
# we use this string so many times
@outlineColorString = @outlineColor.toString()

@iconDarkLineColor = Color.black
@iconDarkLineColor = Color.BLACK

@shortcutsFontSize = 12

Expand Down
4 changes: 2 additions & 2 deletions src/ScriptWdgt.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class ScriptWdgt extends Widget
@tempPromptEntryField = new SimplePlainTextScrollPanelWdgt @savedScript, false, 5
@tempPromptEntryField.disableDrops()
@tempPromptEntryField.contents.disableDrops()
@tempPromptEntryField.color = Color.white
@tempPromptEntryField.color = Color.WHITE
@tempPromptEntryField.addModifiedContentIndicator()

# register this wdgt as one to be notified when the text
Expand All @@ -55,7 +55,7 @@ class ScriptWdgt extends Widget
@tempPromptEntryField.widgetToBeNotifiedOfTextModificationChange = @

@textMorph = @tempPromptEntryField.textWdgt
@textMorph.backgroundColor = Color.transparent
@textMorph.backgroundColor = Color.TRANSPARENT
@textMorph.setFontName nil, nil, @textMorph.monoFontStack
@textMorph.isEditable = true
@textMorph.enableSelecting()
Expand Down
2 changes: 1 addition & 1 deletion src/SimpleDropletAppearance.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class SimpleDropletAppearance extends RectangularAppearance
plusSignTop = p0.add new Point Math.ceil(squareDim/2), -Math.ceil(squareDim/3)
plusSignBottom = p0.add new Point Math.ceil(squareDim/2), Math.ceil(squareDim/3)

color = Color.white
color = Color.WHITE

context.save()

Expand Down
4 changes: 2 additions & 2 deletions src/SimpleDropletWdgt.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ class SimpleDropletWdgt extends Widget

color_hover: new Color 90, 90, 90
color_pressed: new Color 128, 128, 128
color_normal: Color.black
color_normal: Color.BLACK

_acceptsDrops: true
parentFieldToAttachingTheWidgetToAsString: nil

constructor: (@parentFieldToAttachingTheWidgetToAsString) ->
super()
@appearance = new SimpleDropletAppearance @
@setColor Color.black
@setColor Color.BLACK

reactToDropOf: (morphBeingDropped) ->
# TODO we add as FREEFLOATING if we don't pass
Expand Down
2 changes: 1 addition & 1 deletion src/SimplePlainTextPanelWdgt.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class SimplePlainTextPanelWdgt extends PanelWdgt
@disableDrops()
@disableDrops()
@isTextLineWrapping = wraps
@color = Color.white
@color = Color.WHITE
ostmA = new SimplePlainTextWdgt(
textAsString,nil,nil,nil,nil,nil,new Color(230, 230, 130), 1)
ostmA.isEditable = true
Expand Down
2 changes: 1 addition & 1 deletion src/SimplePlainTextScrollPanelWdgt.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class SimplePlainTextScrollPanelWdgt extends ScrollPanelWdgt
@disableDrops()
@contents.disableDrops()
@isTextLineWrapping = wraps
@color = Color.white
@color = Color.WHITE
@textWdgt = new SimplePlainTextWdgt(
textAsString,nil,nil,nil,nil,nil,new Color(230, 230, 130), 1)
@textWdgt.isEditable = true
Expand Down
2 changes: 1 addition & 1 deletion src/SimplePlainTextWdgt.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class SimplePlainTextWdgt extends TextMorph2
@isBold = false,
@isItalic = false,
#@isNumeric = false,
@color = Color.black,
@color = Color.BLACK,
@backgroundColor = nil,
@backgroundTransparency = nil
) ->
Expand Down
4 changes: 2 additions & 2 deletions src/SwitchButtonMorph.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class SwitchButtonMorph extends Widget
buttonShown: 0

# overrides to superclass
color: Color.white
color: Color.WHITE

constructor: (@buttons) ->

Expand All @@ -25,7 +25,7 @@ class SwitchButtonMorph extends Widget
super()

#@color = new Color 255, 152, 152
#@color = Color.white
#@color = Color.WHITE
for eachButton in @buttons
@add eachButton

Expand Down
2 changes: 1 addition & 1 deletion src/WidgetHolderWithCaptionWdgt.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class WidgetHolderWithCaptionWdgt extends Widget
@add @icon
@label = new StringMorph2 @labelContent, WorldMorph.preferencesAndSettings.shortcutsFontSize
@label.fittingSpecWhenBoundsTooLarge = FittingSpecTextInLargerBounds.SCALEUP
@label.color = Color.white
@label.color = Color.WHITE
@label.hasDarkOutline = true
@add @label, nil, nil, true
@label.alignCenter()
Expand Down
2 changes: 1 addition & 1 deletion src/WindowWdgt.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ class WindowWdgt extends SimpleVerticalStackPanelWdgt
else
@label.isBold = WorldMorph.preferencesAndSettings.titleBarBoldText

@label.color = Color.white
@label.color = Color.WHITE
@add @label, nil, nil, nil, true

# upper-left button, often a close button
Expand Down
2 changes: 1 addition & 1 deletion src/apps/AnalogClockWdgt.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class AnalogClockWdgt extends Widget
morphPosition = @position()
aContext.translate morphPosition.x, morphPosition.y

@renderingHelper aContext, Color.white, appliedShadow
@renderingHelper aContext, Color.WHITE, appliedShadow

aContext.restore()

Expand Down
2 changes: 1 addition & 1 deletion src/apps/ReconfigurablePaintWdgt.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ class ReconfigurablePaintWdgt extends StretchableEditableWdgt
contextMain.beginPath()
contextMain.lineWidth="2"
contextMain.fillStyle = Color.white.toString()
contextMain.fillStyle = Color.WHITE.toString()
contextMain.rect(-5,-5,10,10)
contextMain.fill()
@underlyingCanvasMorph.changed()
Expand Down
Loading

0 comments on commit 8b27457

Please sign in to comment.