示例#1
0
文件: ANSI.cs 项目: dsisco11/xLog
        /// <summary>
        /// Strips all of the XTERM command sequences from a string and returns the cleaned string.
        /// </summary>
        public static string Strip(StringPtr Str)
        {
            if (Str == null)
            {
                return(null);
            }
            var Commands = Terminal.Compile_Command_Blocks(Str);

            StringBuilder sb = new StringBuilder();

            foreach (var Block in Commands)
            {
                sb.Append(Block.Text);
            }

            return(sb.ToString());
        }
示例#2
0
文件: ANSI.cs 项目: dsisco11/xLog
 internal static string Set_BG_Custom(int R, int G, int B, StringPtr Str)
 {
     int[] sub = new int[] { 2, R, G, B };
     return(string.Concat(xCmd((int)SGR_CODE.SET_COLOR_CUSTOM_BG, sub), Str.ToString(), sRESET_BG));
 }
示例#3
0
文件: ANSI.cs 项目: dsisco11/xLog
 /// <summary>
 /// Sets the foreground color for the given text
 /// </summary>
 /// <returns>ANSI Color encoded string</returns>
 public static string CustomFG(byte R, byte G, byte B, StringPtr Str) => Set_FG_Custom(R, G, B, Str);