The AccuTerm forum has moved. Go to community.rocketsoftware.com to register for the new Rocket forum. |
Color attributes |
Post Reply |
Author | |
George_Smith
Groupie Joined: April 09 2004 Location: United States Status: Offline Points: 41 |
Post Options
Thanks(0)
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? |
|
PSchellenbach
Admin Group Moderator Joined: December 15 2003 Location: United States Status: Offline Points: 2150 |
Post Options
Thanks(0)
|
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 |
|
zMaestro
Newbie Joined: February 19 2013 Location: United States Status: Offline Points: 5 |
Post Options
Thanks(0)
|
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! |
|
zMaestro
Newbie Joined: February 19 2013 Location: United States Status: Offline Points: 5 |
Post Options
Thanks(0)
|
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! |
|
PSchellenbach
Admin Group Moderator Joined: December 15 2003 Location: United States Status: Offline Points: 2150 |
Post Options
Thanks(0)
|
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 |
|
zMaestro
Newbie Joined: February 19 2013 Location: United States Status: Offline Points: 5 |
Post Options
Thanks(0)
|
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! |
|
PSchellenbach
Admin Group Moderator Joined: December 15 2003 Location: United States Status: Offline Points: 2150 |
Post Options
Thanks(0)
|
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.
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 |
|
zMaestro
Newbie Joined: February 19 2013 Location: United States Status: Offline Points: 5 |
Post Options
Thanks(0)
|
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! |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |