abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
utilColor.c
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [utilColor.c]
4 
5  SystemName [ABC: Logic synthesis and verification system.]
6 
7  PackageName [Handling counter-examples.]
8 
9  Synopsis [Handling counter-examples.]
10 
11  Author [Alan Mishchenko]
12 
13  Affiliation [UC Berkeley]
14 
15  Date [Ver. 1.0. Started - Feburary 13, 2011.]
16 
17  Revision [$Id: utilColor.c,v 1.00 2011/02/11 00:00:00 alanmi Exp $]
18 
19 ***********************************************************************/
20 
21 #include <stdio.h>
22 #include <stdlib.h>
23 #include <string.h>
24 #include "misc/util/abc_global.h"
25 
26 
27 #ifdef WIN32
28 #include <windows.h>
29 #endif
30 
32 
33 ////////////////////////////////////////////////////////////////////////
34 /// DECLARATIONS ///
35 ////////////////////////////////////////////////////////////////////////
36 
37 ////////////////////////////////////////////////////////////////////////
38 /// FUNCTION DEFINITIONS ///
39 ////////////////////////////////////////////////////////////////////////
40 
41 /**Function*************************************************************
42 
43  Synopsis []
44 
45  Description []
46 
47  SideEffects []
48 
49  SeeAlso []
50 
51 ***********************************************************************/
53 {
54 #ifdef WIN32
55  int x, y;
56  HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
57  printf( "Background 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15\n" );
58  for ( y = 0; y < 16; y++ )
59  {
60  printf( "Foreground %02d", y );
61  for ( x = 0; x < 16; x++ )
62  {
63  printf( " " );
64  SetConsoleTextAttribute( hConsole, (WORD)(16 * x + y) );
65  printf( " Hi " );
66  SetConsoleTextAttribute( hConsole, 7 );
67  }
68  printf( "\n" );
69  }
70 #else
71 /*
72  fg[Default] = '[0m'; fg[DefaultBold] = '[1m'
73 
74  fg[Black] = '[0;30m'; fg[DarkGray] = '[1;30m'
75  fg[Blue] = '[0;34m'; fg[LightBlue] = '[1;34m'
76  fg[Green] = '[0;32m'; fg[LightGreen] = '[1;32m'
77  fg[Cyan] = '[0;36m'; fg[LightCyan] = '[1;36m'
78  fg[Red] = '[0;31m'; fg[LightRed] = '[1;31m'
79  fg[Purple] = '[0;35m'; fg[LightPurple] = '[1;35m'
80  fg[Brown] = '[0;33m'; fg[Yellow] = '[1;33m'
81  fg[LightGray] = '[0;37m'; fg[White] = '[1;37m'
82 
83  bg[Black] = '[0;40m'; hi[Underlined] = '[4m'
84  bg[Blue] = '[0;44m'; hi[Blinking] = '[5m'
85  bg[Green] = '[0;42m'; hi[Inverted] = '[7m'
86  bg[Cyan] = '[0;46m'; hi[Concealed] = '[8m'
87  bg[Red] = '[0;41m'
88  bg[Purple] = '[0;45m'
89  bg[Brown] = '[0;43m'
90  bg[LightGray] = '[0;47m'
91 */
92  int x, y;
93  printf( "Background " );
94  for ( x = 0; x < 8; x++ )
95  printf( " [1;4%dm", x );
96  printf( "\n" );
97  for ( y = 0; y < 2; y++ )
98  {
99  printf( "Foreground [%dm ", y );
100  for ( x = 0; x < 8; x++ )
101  printf( " \033[%d;3%dm\033[%dm Hi \033[0m", y&1, y>>1, x );
102  printf( "\n" );
103  }
104  for ( y = 0; y < 16; y++ )
105  {
106  printf( "Foreground [%d;3%dm", y&1, y>>1 );
107  for ( x = 0; x < 8; x++ )
108  printf( " \033[%d;3%dm\033[1;4%dm Hi \033[0m", y&1, y>>1, x );
109  printf( "\n" );
110  }
111  printf( "\033[4mUnderlined\033[0m\n" );
112  printf( "\033[5mBlinking \033[0m\n" );
113  printf( "\033[7mInverted \033[0m\n" );
114  printf( "\033[8mConcealed \033[0m\n" );
115 #endif
116 }
117 
118 ////////////////////////////////////////////////////////////////////////
119 /// END OF FILE ///
120 ////////////////////////////////////////////////////////////////////////
121 
122 
124 
#define ABC_NAMESPACE_IMPL_END
Definition: abc_global.h:108
#define ABC_NAMESPACE_IMPL_START
Definition: abc_global.h:107
ABC_NAMESPACE_IMPL_START void Abc_ColorTest()
DECLARATIONS ///.
Definition: utilColor.c:52