home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / c / pcpilot.zip / CLRCODES.C < prev    next >
Text File  |  1990-01-13  |  1KB  |  53 lines

  1. /*
  2.     CLRCODES.C - Display the 255 Colors and their (hex) codes.
  3. */
  4.  
  5. #include <stdio.h>
  6. #include <kbd.h>
  7.  
  8. void ColorCodes(void);
  9.  
  10. extern int ClrIdx;
  11.  
  12. extern int BorderClr;
  13. extern int TitleClr;
  14. extern int TextClr;
  15. extern int FooterClr;
  16.  
  17. void ColorCodes()
  18. {
  19.     register int i, col, row, y;
  20.  
  21.     ScrPush();
  22.     ShadowBox(6,0,71,13, 2, BorderClr);
  23.     PutStr(33,1, TitleClr, " Color Codes ");
  24.     PutStr(6,2,  BorderClr,
  25.     "╞════════════════════════════════════════════════════════════════╡");
  26.     PutStr(6,11, BorderClr,
  27.     "╞════════════════════════════════════════════════════════════════╡");
  28.     PutStr(7,12, FooterClr,
  29.      "     Press any key to toggle blinking colors    Esc - Quit      ");
  30.  
  31.     for (;;)    {
  32.         col = 7; row = 3;
  33.         for (i=ClrIdx; row<11; i++)    {
  34.             PutStr(col, row, i, " %02X ", i);
  35.             col += 4;
  36.             if (col >= 70)    {
  37.                 col=7;
  38.                 row++;
  39.             }
  40.         }
  41.  
  42.         switch (KbdGetC())    {
  43.             case ESC:
  44.                 ScrPop(1);
  45.                 return;
  46.             default:
  47.                 ClrIdx += 0x80;
  48.                 if (ClrIdx > 0x80) ClrIdx = 0x00;
  49.                 break;
  50.         }
  51.     }
  52. }
  53.