TE Edit Control Java / HTML-JavaScript Help
Product page

TerGetTextColor

Get the foreground and background colors for the specified font id.

boolean TerGetTextColor( FontId)
int FontId;

The editor font id to retrieve color. A valid font id would a value between 0 and TotalFonts - 1.

You can also use this function to get the text color for a stylesheet item by specifying the style id as a negative value for this parameter. Also, use the following constant to specify normal or the current style item:

SID_NORMAL:Normal style item
SID_CUR:Style item being current edited

The following information can be retrieved by using the TerGetOutColor (TerGetOutColor, http://www.) and TerGetOutStr methods upon a successful return from this method

Color TextColor;

Get the text foreground color. Example:

 if (TerGetTextColor(FontId)) {  
   Color TextColor=TerGetOutColor("TextColor");
 }
String TextColor

Get the text foreground color in Html string format. Example:

if (TerGetTextColor(FontId)){
   String TextColor=TerGetOutStr("TextColor");
}
Color TextBkColor;

Get the text background color. Example:

 if (TerGetTextColor(FontId)) {  
   Color BackColor=TerGetOutColor("TextBackColor");

}

String TextBkColor;

Get the text background color in Html text format. Example:

 if (TerGetTextColor(FontId)) {  
   String BackColor=TerGetOutStr("TextBackColor");

}

Return Value: This function returns true when successful.