Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 
 
 

57 rader
1.5 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 GNU Lesser General Public
  10. * License as published by the Free Software Foundation; either
  11. * version 2 of the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  21. * 02111-1307 USA
  22. */
  23. #include "config.h"
  24. #include <stdio.h>
  25. #include "caca.h"
  26. int main(int argc, char **argv)
  27. {
  28. int i, j;
  29. if(caca_init())
  30. return 1;
  31. caca_clear();
  32. for(i = 0; i < 16; i++)
  33. {
  34. caca_set_color(CACA_COLOR_LIGHTGRAY, CACA_COLOR_BLACK);
  35. caca_printf(4, i + (i >= 8 ? 4 : 3), "'%c': %i (%s)",
  36. 'a' + i, i, caca_get_color_name(i));
  37. for(j = 0; j < 16; j++)
  38. {
  39. caca_set_color(i, j);
  40. caca_putstr((j >= 8 ? 41 : 40) + j * 2, i + (i >= 8 ? 4 : 3), "# ");
  41. }
  42. }
  43. caca_refresh();
  44. caca_wait_event(CACA_EVENT_KEY_PRESS);
  45. caca_end();
  46. return 0;
  47. }