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.
 
 
 
 
 
 

58 lines
1.3 KiB

  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 "cucul.h"
  16. #include "caca.h"
  17. int main(int argc, char **argv)
  18. {
  19. cucul_t *qq;
  20. caca_t *kk;
  21. int i, j;
  22. qq = cucul_init();
  23. if(!qq)
  24. return 1;
  25. kk = caca_attach(qq);
  26. if(!kk)
  27. return 1;
  28. cucul_clear(qq);
  29. for(i = 0; i < 16; i++)
  30. {
  31. cucul_set_color(qq, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK);
  32. cucul_printf(qq, 4, i + (i >= 8 ? 4 : 3), "'%c': %i (%s)",
  33. 'a' + i, i, cucul_get_color_name(i));
  34. for(j = 0; j < 16; j++)
  35. {
  36. cucul_set_color(qq, i, j);
  37. cucul_putstr(qq, (j >= 8 ? 41 : 40) + j * 2, i + (i >= 8 ? 4 : 3),
  38. "# ");
  39. }
  40. }
  41. caca_display(kk);
  42. caca_wait_event(kk, CACA_EVENT_KEY_PRESS);
  43. caca_detach(kk);
  44. cucul_end(qq);
  45. return 0;
  46. }