Index | Collapse All Expand All

SetForeColor Method
Label Class Members Examples See Also

Beta Documentation - Subject to change.
Sets the foreground color.

# Syntax

Lua
    function Label:SetForeColor(value);

#### Parameters

value
  Type: Color
  The color used for drawing the text.

# Remarks

Sets the color used to draw the text.

# Examples

This example demonstrates changing the color of the text displayed by a label.

Setting the Label Text Color | Copy Code
--- | ---
            import "Turbine.UI.Lotro";

            window = Turbine.UI.Lotro.Window();
            window:SetPosition( 200, 200 );
            window:SetSize( 200, 200 );
            window:SetText( "Test" );
            window:SetVisible( true );

            label = Turbine.UI.Label();
            label:SetParent( window );
            label:SetSeletable( true );
            label:SetPosition( 40, 60 );
            label:SetSize( 120, 80 );
            label:SetBackColor( Turbine.UI.Color( 0.2, 0.2, 0.2 ) );
            label:SetForeColor( Turbine.UI.Color( 1, 1, 0 ) );
            label:SetText( "Hello world!" );
            label:SetTextAlignment( Turbine.UI.ContentAlignment.MiddleCenter );

# See Also

- Label
- Turbine.UI