public static string GetFGString(this TextColor color) { var output = color.GetForegroundCode().ToString(); if (color is TextColor.Custom custom) { output += ";2;" + (custom.HexCode >> 16) // r + ";" + ((custom.HexCode & 0x00ff00) >> 8) // g + ";" + (custom.HexCode & 0x0000ff); // b } return(output); }