abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
utilColor.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "misc/util/abc_global.h"

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START void Abc_ColorTest ()
 DECLARATIONS ///. More...
 

Function Documentation

ABC_NAMESPACE_IMPL_START void Abc_ColorTest ( )

DECLARATIONS ///.

CFile****************************************************************

FileName [utilColor.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Handling counter-examples.]

Synopsis [Handling counter-examples.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - Feburary 13, 2011.]

Revision [

Id:
utilColor.c,v 1.00 2011/02/11 00:00:00 alanmi Exp

]FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 52 of file utilColor.c.

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 }