nsf / termbox

Library for writing text-based user interfaces
http://code.google.com/p/termbox
MIT License
1.96k stars 185 forks source link

Confution about output mode 216 #118

Open mitchellwrosen opened 6 years ago

mitchellwrosen commented 6 years ago
#include <assert.h>
#include "termbox.h"

int main() {
  struct tb_event event;

  assert ( tb_init() == 0 );

  tb_select_output_mode(TB_OUTPUT_216);

  tb_clear();
  tb_change_cell(0, 0, 'x', TB_DEFAULT, 20);
  tb_present();

  tb_poll_event(&event);
  tb_shutdown();
}

The above program draws a single x at coords 0,0, then exits when a key is pressed. Notice that the foreground attribute is TB_DEFAULT and the background is 20. When I run this program, I see an orange x on a blue background. This seems to suggest that my default foreground color is orange.

However, when I set both the foreground and background to TB_DEFAULT, I see a white x on a blackish (unaltered from my normal terminal) background.

Why is this? Thanks :)