Color-related properties of the HostOptions object
Related Topics

image\validfor_v.gif

Applies To Objects

HostOptions

Description

The properties in this group affect how the screen displays colors. You can use these properties to change the colors displayed on your screen and to add color to the text in your display window by assigning (mapping) the various character attributes and their combinations to different colors. They are equivalent to the options on the page Settings, Display, Color or Settings, Colors.

Syntax

Unless noted, all color-related properties have the following syntax:

object.Property

Element

Description

Object

The HostOptions object.

Property

A color-related property.

 

Names and Descriptions of individual properties

AttributeForeground Property and AttributeBackground Property

Returns or sets the foreground and background color mapped to a particular attribute or combination of attributes.

 

 

colorindex = object.AttributeForeground(attribute)

object.AttributeForeground(attribute) = colorindex

 

colorindex = object.AttributeBackground(attribute)

object.AttributeBackground(attribute) = colorindex

 

Element

Description

Object

The HostOptions object.

attribute

A value from the following table indicating which attribute or combination of attributes to which you are referring.

colorindex

The color which is displayed for characters or their backgrounds which have that attribute or combination of attributes. The color is represented as a color index, 0 to 15.

 

 

Use the following constants to indicate a particular combination of attributes.

Constant

Value

XAttributeNormal

0

XBlink

8

XBlinkBold

9

XBlinkInverse

12

XBlinkInverseBold

13

XBlinkInverseUnderline

14

XBlinkInverseUnderlineBold

15

XBlinkUnderline

10

XBlinkUnderlineBold

11

XBold

1

XHistory

16

XInverse

4

XInverseBold

5

XinverseUnderline

6

XInverseUnderlineBold

7

XUnderline

2

XUnderlineBold

3

 

Color Property

Returns or sets the RGB (Red, Green, Blue) value for a particular color in the array of 16 VT colors.

RGBvalue = object.Color(colorindex)

object.Color(colorindex) = RGBvalue

Element

Description

Object

The HostOptions object.

colorindex

A number 0 to 15 indicating the VT color index to which you are referring.

RGBvalue

The actual color which is displayed for that VT color index. The value is calculated as Red*65536 + Green*256 + Blue.

 

 

ISOColor Property

Returns or sets whether received ISO color sequences have any effect. Set this property TRUE to recognize ISO color sequences. The host uses ISO color sequences to control foreground and background colors independently of other visual attributes.

 

LockUserColors Property

Returns or sets whether to prevent the host from changing colors. Set this property TRUE to prevent the host from changing colors. Normally the host can change any of the 16 colors defined by the display. However, some host applications fail to restore the colors, altering the appearance of text and graphics from other applications.

 

MapColorBlink Property

Returns or sets whether to map the Blink attribute to color. Set this property TRUE to map colors to characters with the blink character attribute.

 

MapColorBold Property

Returns or sets whether to map the Bold (or in a Wyse session, Dim) attribute to color. Set this property TRUE to map colors to characters with the bold character attribute.

 

MapColorInverse Property

Returns or sets whether to map the Inverse attribute to color. Set this property TRUE to map colors to characters with the inverse character attribute.

 

MapColorUnderline Property

Returns or sets whether to map the Underline attribute to color. Set this property TRUE to map colors to characters with the underline character attribute

 

ResetAttributes Method

Reset the foreground and background attribute mappings to factory values. It does not change the RGB combination currently used for each color index.

 

ResetColors Method

Resets the RGB combination used for each color index to factory values.

 

UseExactColors Property

Returns or sets whether to give EXTRA!/KEA! exact control over the colors it displays. This option is available only if you have a 256 color display (that is, a display with a palette). Set this property TRUE to make 16 of the 256 available colors exactly match the VT colors. You can change any of the 16, defining your own exact colors. Set this property FALSE to disable the palette. The requested color is matched to the closest available Windows pre-set color.