Livecode Wiki
Advertisement

Specifies the color of object text and borders.

Synonyms: forecolor, firstcolor, textcolor, thumbcolor, fillfore, penfore

Syntax:

set the foregroundColor of [<chunk> of] <field> to {empty| <colorName> | <RGBColor>}

Examples:

set the foregroundColor of button "Help!" to "red"
set the foregroundColor of this card to "#FF00FF"
set the foregroundColor of the mouseChunk to 0,255,0

Use the foregroundColor property to change the color of text or the color that fills an object.

Setting the foregroundColor of an object to empty allows the foregroundColor of the object's owner to show through. Use the effective keyword to find out what color is used for the object, even if its own foregroundColor is empty.

The setting of the foregroundColor property has different effects, depending on the object type:

  • The foregroundColor of a stack, card, or group determines the foregroundColor of each object(glossary) in the stack, card, or group that does not have its own foregroundColor.
  • The foregroundColor of a button is used for the text of the button. If the button's showName property is false, the foregroundColor has no effect.
  • The foregroundColor of a field determines the color of the field's text. If you set the foregroundColor of a chunk of a field, only that chunk is affected. If a chunk of text contains text of more than one color, the foregroundColor of that chunk reports "mixed". The foregroundColor also determines the color of the blinking insertion point when it is in the field.
  • The foregroundColor of a scrollbar determines the text color used to show the value of the scrollbar's current position. If the scrollbar's showValue property is false, the foregroundColor has no effect.
  • The foregroundColor of a graphic determines the color of the graphic's outline. (The graphic's border is outside the outline. By default, the showBorder property of newly-created graphics is set to false, so this border is not visible.)
  • The foregroundColor of a player, audio clip, video clip, or EPS object has no effect.
  • The foregroundColor of an image is the first color in the image's color palette.

If an object's foregroundPattern is set, the pattern is shown instead of the color specified by foregroundColor.

See also: mouseColor (function), value (function), graphic (object), button (object), scrollbar (object), stack (object), field (object), image (object), linkColor (property), HTMLText (property), owner (property), showBorder (property), showName (property), showValue (property), linkHiliteColor (property), foregroundPattern (property), RTFText (property),

Advertisement