private static string GetColorCode2Digits(IrcFormatText.Color color) { string s = GetColorCodeInt(color).ToString(); while (s.Length < 2) { s = "0" + s; } return(s); }
public static string ColorText(this string text, IrcFormatText.Color fg, IrcFormatText.Color bg = IrcFormatText.Color.Reset) { return (IrcFormatText.StyleChar[IrcFormatText.GetStyleCodeInt(IrcFormatText.Style.Color)] + GetColorCode2Digits(fg) + ((bg != IrcFormatText.Color.Reset) ? "," + GetColorCode2Digits(bg) : "" ) + text.TrimEnd() + IrcFormatText.StyleChar[IrcFormatText.GetStyleCodeInt(IrcFormatText.Style.Color)] ); }
private static string GetColorCodeName(IrcFormatText.Color color) { return(color.ToString()); }
private static int GetColorCodeInt(IrcFormatText.Color color) { return((int)color); }