コード例 #1
0
 static Attribute MakeColor(short f, short b)
 {
     Curses.InitColorPair(++last_color_pair, f, b);
     return(new Attribute {
         value = Curses.ColorPair(last_color_pair)
     });
 }
コード例 #2
0
 /// <summary>
 /// Creates a curses color from the provided foreground and background colors
 /// </summary>
 /// <param name="foreground">Contains the curses attributes for the foreground (color, plus any attributes)</param>
 /// <param name="background">Contains the curses attributes for the background (color, plus any attributes)</param>
 /// <returns></returns>
 public static Attribute MakeColor(short foreground, short background)
 {
     Curses.InitColorPair(++last_color_pair, foreground, background);
     return(new Attribute()
     {
         value = Curses.ColorPair(last_color_pair)
     });
 }
コード例 #3
0
ファイル: CursesDriver.cs プロジェクト: hong1990/gui.cs
        //static short last_color_pair = 16;

        /// <summary>
        /// Creates a curses color from the provided foreground and background colors
        /// </summary>
        /// <param name="foreground">Contains the curses attributes for the foreground (color, plus any attributes)</param>
        /// <param name="background">Contains the curses attributes for the background (color, plus any attributes)</param>
        /// <returns></returns>
        public static Attribute MakeColor(short foreground, short background)
        {
            var v = (short)((int)foreground | background << 4);

            //Curses.InitColorPair (++last_color_pair, foreground, background);
            Curses.InitColorPair(v, foreground, background);
            return(new Attribute(
                       //value: Curses.ColorPair (last_color_pair),
                       value: Curses.ColorPair(v),
                       foreground: (Color)foreground,
                       background: (Color)background));
        }