/// <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) }); }
static Attribute MakeColor(short f, short b) { Curses.InitColorPair(++last_color_pair, f, b); return(new Attribute() { value = Curses.ColorPair(last_color_pair) }); }
//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)); }
/// <summary> /// Creates a new Curses color to be used by Gui.cs apps /// </summary> public static uint MakeColor(short f, short b) { Curses.InitPair(++last_color_pair, f, b); return(Curses.ColorPair((uint)last_color_pair)); }