Rocket Software Homepage
Forum Home Forum Home > AccuTerm Knowledge Base (read only) > Green Screen
  New Posts New Posts RSS Feed - Color attributes
  FAQ FAQ  Forum Search   Register Register  Login Login

The AccuTerm forum has moved. Go to community.rocketsoftware.com to register for the new Rocket forum.

Forum LockedColor attributes

 Post Reply Post Reply
Author
Message
George_Smith View Drop Down
Groupie
Groupie


Joined: April 09 2004
Location: United States
Status: Offline
Points: 41
Post Options Post Options   Thanks (0) Thanks(0)   Quote George_Smith Quote  Post ReplyReply Direct Link To This Post Topic: Color attributes
    Posted: February 21 2006 at 6:48am
I need access to more colors than are available with the Normal, Dim, and Reverse attributes of the Enhanced A2 emulation. There are many more combinations available, but they all involve underlines and/or blinking, the latter of which I find particularly unacceptable!

Is there a way use these attributes as colors without their native characteristics?


Back to Top
PSchellenbach View Drop Down
Admin Group
Admin Group

Moderator

Joined: December 15 2003
Location: United States
Status: Offline
Points: 2150
Post Options Post Options   Thanks (0) Thanks(0)   Quote PSchellenbach Quote  Post ReplyReply Direct Link To This Post Posted: February 22 2006 at 2:19am
Hi George -

Yes - you can use blinking, underline, etc without their native characteristics. In the Settings dialog, Screen tab, there are check boxes for disabling blinking and underline. Blank is achieved by using the same foreground and background colors, so you can override that one easily by simply changing one of the colors.

Thanks,

Pete
Back to Top
zMaestro View Drop Down
Newbie
Newbie


Joined: February 19 2013
Location: United States
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote zMaestro Quote  Post ReplyReply Direct Link To This Post Posted: June 03 2013 at 11:54am
Hi Pete. I'm in the same boat and would like to use more colors in our non-GUI screens. I understand that I can assign colors to the Colors property, however I don't know how to display all of them once set.

There are 26 indices available for the Colors property and only 6 sets of @ Terminal Functions to turn modes on/off.

For example, I see that I can display red text with the following.
EQU REVERSE TO 4
EQU RED TO 12
EQU DKBLUE TO 1
CRT CHAR(27):CHAR(2):'P':'InitSession.Colors(':REVERSE:') = ':RED + (DKBLUE*16):CHAR(25):CHAR(13):@(-13):'Red':@(-14)

If I were to assign CYAN to Colors(46), how would I now display that?

Thanks much!
Back to Top
zMaestro View Drop Down
Newbie
Newbie


Joined: February 19 2013
Location: United States
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote zMaestro Quote  Post ReplyReply Direct Link To This Post Posted: June 04 2013 at 6:23am
One more thing... It appears that both @(-13) and @(-83) look to Colors(4). Is there a way to separate these so that they may be set differently?

Thanks again!
Back to Top
PSchellenbach View Drop Down
Admin Group
Admin Group

Moderator

Joined: December 15 2003
Location: United States
Status: Offline
Points: 2150
Post Options Post Options   Thanks (0) Thanks(0)   Quote PSchellenbach Quote  Post ReplyReply Direct Link To This Post Posted: June 05 2013 at 3:29am
Hi zMaestro -

You may need to use the private AccuTerm escape sequences to set foreground / background colors instead of the @(-xx) system function. I'm not sure what MV platform you are using, but my D3 documentation shows @(-83) as "reserved", so I cannot comment on why @(-83) and @(-13) use the same color.

The way AccuTerm uses colors varies by terminal type, but the most common way is to assign a foreground & background color to each supported visual attribute combination. This typically allows 32 color combinations if you include common attributes of reverse, blink, underline, dim, blank. For VT terminals, use bold instead of dim, which still defines 32 color combinations.

The actual color (foreground or background) is taken from a palette of 16 colors which you can customize. There are several pre-defined palettes, using legacy (QBASIC) colors, new AccuTerm 7 colors (slightly muted versions of the QBASIC colors), or "system colors" which are defined by the display properties and Windows theme being used on the PC.

The system @(-xx) function is typically limited to a small subset of visual attribute combinations, so if you want more than a few color combinations, you need to use the terminal's native attribute escape sequence or the private AccuTerm escape sequences. The native escape sequence will give you access to all of the attributes that the terminal supports, typically 32 combinations. The AccuTerm escape sequences will give you access to all 256 combinations (16 foreground x 16 background colors).

Both escape sequences are defined in the AccuTerm help, in the AccuTerm Reference section.

Thanks,

Pete
Back to Top
zMaestro View Drop Down
Newbie
Newbie


Joined: February 19 2013
Location: United States
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote zMaestro Quote  Post ReplyReply Direct Link To This Post Posted: June 05 2013 at 6:22am
Thanks, Pete. Your quick reply is greatly appreciated. I'm now changing the foreground colors successfully using the AccuTerm escape sequences in our VT220 emulation.

Is there a way to determine the session's previous (or even default) foreground color so I may "turn off" the new color?

Thanks again!
Back to Top
PSchellenbach View Drop Down
Admin Group
Admin Group

Moderator

Joined: December 15 2003
Location: United States
Status: Offline
Points: 2150
Post Options Post Options   Thanks (0) Thanks(0)   Quote PSchellenbach Quote  Post ReplyReply Direct Link To This Post Posted: June 05 2013 at 9:39am
Hi zMaestro -

The simple answer is to use the built-in VT220 escape sequence to save & restore the terminal state. This saves the current attribute & color, cursor position and character set. Save is ESC 7 and restore is ESC 8.
PRINT CHAR(27):'7': ;* save state

PRINT CHAR(27):'8': ;* restore state


Note that the save/restore is not recursive - you cannot nest these.

If you just need to save the color, you can use scripting to query the session for the current color and send it to the host. The script is constructed as a string in your program and sent to AccuTerm using PRINT, then the answer is returned to the program using INPUT. Its a bit complex. Let me know if you need an example.

Thanks,

Pete
Back to Top
zMaestro View Drop Down
Newbie
Newbie


Joined: February 19 2013
Location: United States
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote zMaestro Quote  Post ReplyReply Direct Link To This Post Posted: June 05 2013 at 10:02am
Saving/Restoring the state works perfectly. Now I may alter specific text on the screen and return to the user's preferred color settings.

Much appreciated!
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.03
Copyright ©2001-2019 Web Wiz Ltd.