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