/// <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()); }
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)); }
/// <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);