Fore Color

Fore Color specifies the color of the text for window elements, containers, and widgets.

Fore color can be changed in Lycia Theme Designer and via css styles:

Theme property filter XML code:

<DoStyleAction>

  <SetProperty>

    <PropertyPath>

      <PropertyName>ForeColor</PropertyName>

    </PropertyPath>

    <PropertyValue type="<..>" RedColor="<..>" GreenColor="<..>" BlueColor="<..>" Alpha="<..>" />

  </SetProperty>

</DoStyleAction>

CSS property code:

color

Default value:

not specified

Associated containers, widgets and theme elements:

BorderPanel

CoordPanel

GridPanel

GroupBox

StackPanel

ScrollViewer

TabPage

BlobViewer

Button

Calendar

CheckBox

ComboBox

FunctionField

Label

MenuGroup

MenuCommand

RadioGroup

TextArea

TextField

Toolbar

ToolbarButton

TimeEditField

Associated ui methods:

SetAlpha  

GetAlpha

SetBlueColor  

GetBlueColor

SetGreenColor  

GetGreenColor

SetRedColor  

GetRedColor

SetSystemColorName  

GetSystemColorName

Influence and behavior:

In Lycia Theme Designer, there are three ways to change font color: New Custom Color, Default Color, New System Color.

With New Custom Color, you can choose among the available custom colors or add your own custom color:

Choosing a custom color

among the available standard ones

Adding a new custom color

Yon can add a new custom color by entering its RGB or hex values as well as by moving your cursor directly over the palette in the Advanced colors page

With Default Color, you choose the default color (i.e. the color set in the system theme) to be used for the text:

With New System Color, you choose the system color (i.e. one of the colors set for the application server) to be used for the text:

 

You can use css styles to change font color of the element:

.qx-aum-label .qx-text {

    padding: 2px;

    padding: 5px 10px;

    color: white !important;

    font: bold 14px "Calibri","Helvetica Neue", Sans-Serif;

}

Regardless of whether you used Lycia Theme Designer or css, you get this at runtime:

 

At runtime, you can use ui methods to change the color of the text used in form elements - containers, widgets, toolbars, and menubars.

It can be done in two ways:

With ui.SystemColor, you must

  1. define a variable of this data type,
  2. apply the <var>.SetSystemColorName() to this variable,
  3. specify a name of a system color as the argument for this method, and
  4. apply the fore color to the form element by the <var>.setForeColor() method.

4gl code sample

MAIN
DEFINE lb1 ui.Label
DEFINE sc ui.SystemColor
OPEN WINDOW w WITH FORM "system_color" ATTRIBUTE(BORDER)
LET lb1 = ui.Label.ForName("lb1")
CALL sc.SetSystemColorName("Purple")
CALL lb1.SetForeColor(sc)
CALL fgl_getkey()
END MAIN

default appearance

(in the form)

runtime appearance

Customized colors are defined according to the RGB color model, where

<var>.Alpha()

specifies the degree of the color's transparency (from 0 for completely transparent to 255 for completely opaque)

<var>.RedColor()

indicates how much of the red is included in the color (from 0 to 255)

<var>.GreenColor()

indicates how much of the green is included in the color (from 0 to 255)

<var>.BlueColor()

indicates how much of the blue is included in the color (from 0 to 255)

With ui.CustomizedColor, you must

  1. define a variable of this data type,
  2. assign a value to this variable via the ui.CustomizedColor.Create() method,
  3. use <var>.Alpha(), <var>.RedColor(), <var>.GreenColor(), and <var>.BlueColor() methods to define the necessary color,
  4. apply the fore color to the form element by the <var>.setForeColor() method.

4gl code sample

MAIN
DEFINE lb1 ui.Label
DEFINE cc ui.CustomizedColor
OPEN WINDOW w WITH FORM "custom_color" ATTRIBUTE(BORDER)
LET lb1 = ui.Label.ForName("lb1")
LET cc = ui.CustomizedColor.Create("cc")
CALL cc.SetAlpha(255)
CALL cc.SetRedColor(0)
CALL cc.SetGreenColor(153)
CALL cc.SetBlueColor(207)
CALL lb1.SetForeColor(cc)
CALL fgl_getkey()
END MAIN

default appearance

(in the form)

runtime appearance

Try the example program to learn more about manipulating fore colors with ui methods.

 

 

Contact Us

Privacy Policy

Copyright © 2024 Querix, (UK) Ltd.