|
http://www.hackerschool.org/HS_Boards/zboard.php?AllArticle=true&no=1625 [복사]
#include <stdio.h>
#include <windows.h> // 이 두 header file은 색을 입히기 위해 반드시 필요한 것입니다.
#define COL GetStdHandle(STD_OUTPUT_HANDLE) // 콘솔창의 핸들정보 받기
#define BLACK SetConsoleTextAttribute(COL, 0x0000); // 검정색
#define DARK_BLUE SetConsoleTextAttribute(COL, 0x0001); // 파란색
#define GREEN SetConsoleTextAttribute(COL, 0x0002); // 녹색
#define BLUE_GREEN SetConsoleTextAttribute(COL, 0x0003); // 청녹색
#define BLOOD SetConsoleTextAttribute(COL, 0x0004); // 검붉은색
#define PURPLE SetConsoleTextAttribute(COL, 0x0005); // 보라색
#define GOLD SetConsoleTextAttribute(COL, 0x0006); // 금색
#define ORIGINAL SetConsoleTextAttribute(COL, 0x0007); // 밝은 회색 (ORIGINAL CONSOLE COLOR)
#define GRAY SetConsoleTextAttribute(COL, 0x0008); // 회색
#define BLUE SetConsoleTextAttribute(COL, 0x0009); // 파란색
#define HIGH_GREEN SetConsoleTextAttribute(COL, 0x000a); // 연두색
#define SKY_BLUE SetConsoleTextAttribute(COL, 0x000b); // 하늘색
#define RED SetConsoleTextAttribute(COL, 0x000c); // 빨간색
#define PLUM SetConsoleTextAttribute(COL, 0x000d); // 자주색
#define YELLOW SetConsoleTextAttribute(COL, 0x000e); // 노란색
#define WHITE SetConsoleTextAttribute(COL, 0x000f); // 흰색
★ Original로 되어 있는 색은 원래 console을 실행했을 때의 text color 입니다.
★ 색깔과 음영
뒤에 있는 [0x000f]에서 끝의 두 자리가 color code 입니다.
주의할 점은, 16진수로 되어 있기 때문에 { 0 ~ f } 까지만 넣으셔야 합니다.
[ 0 x 0 0 0 f ]
음영색 글자색
끝 두 자리만 바꿔주면, source의 결과물을 화려하게 바꿀 수 있습니다. |
Hit : 20749 Date : 2010/12/15 05:54
|