You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

colors.c 1.1 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * colors display all possible libcaca colour pairs
  3. * Copyright (c) 2003-2004 Sam Hocevar <sam@zoy.org>
  4. * All Rights Reserved
  5. *
  6. * $Id$
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the Do What The Fuck You Want To
  10. * Public License, Version 2, as published by Sam Hocevar. See
  11. * http://sam.zoy.org/wtfpl/COPYING for more details.
  12. */
  13. #include "config.h"
  14. #include <stdio.h>
  15. #include "caca.h"
  16. int main(int argc, char **argv)
  17. {
  18. int i, j;
  19. if(caca_init())
  20. return 1;
  21. caca_clear();
  22. for(i = 0; i < 16; i++)
  23. {
  24. caca_set_color(CACA_COLOR_LIGHTGRAY, CACA_COLOR_BLACK);
  25. caca_printf(4, i + (i >= 8 ? 4 : 3), "'%c': %i (%s)",
  26. 'a' + i, i, caca_get_color_name(i));
  27. for(j = 0; j < 16; j++)
  28. {
  29. caca_set_color(i, j);
  30. caca_putstr((j >= 8 ? 41 : 40) + j * 2, i + (i >= 8 ? 4 : 3), "# ");
  31. }
  32. }
  33. caca_refresh();
  34. caca_wait_event(CACA_EVENT_KEY_PRESS);
  35. caca_end();
  36. return 0;
  37. }