Method: Curses.pair_content

Defined in:
ext/curses/curses.c

.pair_content(pair) ⇒ Object

Returns a 2 item Array, with the foreground and background color, in pair



1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
# File 'ext/curses/curses.c', line 1450

static VALUE
curses_pair_content(VALUE obj, VALUE pair)
{
    curses_stdscr();
#ifdef HAVE_EXTENDED_PAIR_CONTENT
    {
  int f, b;
  if (extended_pair_content(NUM2INT(pair), &f, &b) == ERR)
      return Qnil;
  return rb_ary_new3(2, INT2FIX(f), INT2FIX(b));
    }
#else
    {
  short f, b;
  if (pair_content(NUM2INT(pair), &f, &b) == ERR)
      return Qnil;
  return rb_ary_new3(2, INT2FIX(f), INT2FIX(b));
    }
#endif
}