Esempio n. 1
0
 public static string StyleText(this string text, IrcFormatText.Style style = IrcFormatText.Style.Reset)
 {
     if (style == IrcFormatText.Style.Reset)
     {
         return(text);
     }
     return
         (IrcFormatText.StyleChar[IrcFormatText.GetStyleCodeInt(style)]
          + text
          + IrcFormatText.StyleChar[IrcFormatText.GetStyleCodeInt(style)]
         );
 }
Esempio n. 2
0
 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)]
         );
 }