PowerTCP Emulation for .NET
AnsiColor Class
Members  Example 




Provides fine control of display colors. Includes eight "normal" and eight "bold" (aka "bright" or "light") colors.
Object Model
AnsiColor Class
Syntax
<SerializableAttribute()>
Public Class AnsiColor 
Dim instance As AnsiColor
[Serializable()]
public class AnsiColor 
[Serializable()]
public __gc class AnsiColor 
[Serializable()]
public ref class AnsiColor 
Remarks
Set Style to use a pre-defined color scheme. Setting individual colors will automatically set Style to AnsiStyle.Custom.
Example
The following example demonstrates how set normal colors as an intensity percentage of bold colors.
private void updateColors(Vt vt, int intensity)
{
    //Update colors to a specified intensity (0-100).
    //0 is black and 100 is the bold color.
    int val = ((255 * intensity) / 100);
    vt.AnsiColor.BlackBold = Color.Gray;
    vt.AnsiColor.RedBold = Color.Red;
    vt.AnsiColor.GreenBold = Color.Lime;
    vt.AnsiColor.YellowBold = Color.Yellow;
    vt.AnsiColor.BlueBold = Color.Blue;
    vt.AnsiColor.MagentaBold = Color.Magenta;
    vt.AnsiColor.CyanBold = Color.Cyan;
    vt.AnsiColor.WhiteBold = Color.White;
    vt.AnsiColor.Black = Color.Black;
    vt.AnsiColor.Red = Color.FromArgb(val, 0, 0);
    vt.AnsiColor.Green = Color.FromArgb(0, val, 0);
    vt.AnsiColor.Yellow = Color.FromArgb(val, val, 0);
    vt.AnsiColor.Blue = Color.FromArgb(0, 0, val);
    vt.AnsiColor.Magenta = Color.FromArgb(val, 0, val);
    vt.AnsiColor.Cyan = Color.FromArgb(0, val, val);
    vt.AnsiColor.White = Color.FromArgb(val, val, val);
    vt.Refresh();
}
Private Sub updateColors(ByVal vt As Vt, ByVal intensity As Integer)
    'Update colors to a specified intensity (0-100).
    '0 is black and 100 is the bold color.
    Dim val As Integer = ((255 * intensity) / 100)
    vt.AnsiColor.BlackBold = Color.Gray
    vt.AnsiColor.RedBold = Color.Red
    vt.AnsiColor.GreenBold = Color.Lime
    vt.AnsiColor.YellowBold = Color.Yellow
    vt.AnsiColor.BlueBold = Color.Blue
    vt.AnsiColor.MagentaBold = Color.Magenta
    vt.AnsiColor.CyanBold = Color.Cyan
    vt.AnsiColor.WhiteBold = Color.White
    vt.AnsiColor.Black = Color.Black
    vt.AnsiColor.Red = Color.FromArgb(val, 0, 0)
    vt.AnsiColor.Green = Color.FromArgb(0, val, 0)
    vt.AnsiColor.Yellow = Color.FromArgb(val, val, 0)
    vt.AnsiColor.Blue = Color.FromArgb(0, 0, val)
    vt.AnsiColor.Magenta = Color.FromArgb(val, 0, val)
    vt.AnsiColor.Cyan = Color.FromArgb(0, val, val)
    vt.AnsiColor.White = Color.FromArgb(val, val, val)
    vt.Refresh()
End Sub
Inheritance Hierarchy

System.Object
   Dart.Emulation.AnsiColor

See Also

Reference

AnsiColor Members
Dart.Emulation Namespace


PowerTCP Emulation for .NET Documentation Version 4.7
© 2018 Dart Communications. All Rights Reserved.
Send comments on this topic