C

printf color

1. 개요

printf로 출력시 색상 적용

 

2. 적용 화면

 

3. Source Code

#include <stdio.h>
 
int main(){
        printf("00 : \x1b[00m    color   \x1b[0m\t");
        printf("01 : \x1b[01m    color   \x1b[0m\t");
        printf("02 : \x1b[02m    color   \x1b[0m\t");
        printf("03 : \x1b[03m    color   \x1b[0m\t");
        printf("04 : \x1b[04m    color   \x1b[0m\t");
        printf("05 : \x1b[05m    color   \x1b[0m\t");
        printf("06 : \x1b[06m    color   \x1b[0m\t");
        printf("07 : \x1b[07m    color   \x1b[0m\t");
        printf("08 : \x1b[08m    color   \x1b[0m\t");
        printf("09 : \x1b[09m    color   \x1b[0m\n");
 
        printf("\n");
 
        printf("30 : \x1b[30m    color   \x1b[0m\t");
        printf("31 : \x1b[31m    color   \x1b[0m\t");
        printf("32 : \x1b[32m    color   \x1b[0m\t");
        printf("33 : \x1b[33m    color   \x1b[0m\t");
        printf("34 : \x1b[34m    color   \x1b[0m\t");
        printf("35 : \x1b[35m    color   \x1b[0m\t");
        printf("36 : \x1b[36m    color   \x1b[0m\t");
        printf("37 : \x1b[37m    color   \x1b[0m\t");
        printf("38 : \x1b[38m    color   \x1b[0m\t");
        printf("39 : \x1b[39m    color   \x1b[0m\n");
 
        printf("\n");
 
        printf("40 : \x1b[40m    color   \x1b[0m\t");
        printf("41 : \x1b[41m    color   \x1b[0m\t");
        printf("42 : \x1b[42m    color   \x1b[0m\t");
        printf("43 : \x1b[43m    color   \x1b[0m\t");
        printf("44 : \x1b[44m    color   \x1b[0m\t");
        printf("45 : \x1b[45m    color   \x1b[0m\t");
        printf("46 : \x1b[46m    color   \x1b[0m\t");
        printf("47 : \x1b[47m    color   \x1b[0m\t");
        printf("48 : \x1b[48m    color   \x1b[0m\t");
        printf("49 : \x1b[49m    color   \x1b[0m\n");
 
        printf("\n");
 
        printf("90 : \x1b[90m    color   \x1b[0m\t");
        printf("91 : \x1b[91m    color   \x1b[0m\t");
        printf("92 : \x1b[92m    color   \x1b[0m\t");
        printf("93 : \x1b[93m    color   \x1b[0m\t");
        printf("94 : \x1b[94m    color   \x1b[0m\t");
        printf("95 : \x1b[95m    color   \x1b[0m\t");
        printf("96 : \x1b[96m    color   \x1b[0m\t");
        printf("97 : \x1b[97m    color   \x1b[0m\t");
        printf("98 : \x1b[98m    color   \x1b[0m\t");
        printf("99 : \x1b[99m    color   \x1b[0m\n");
}

 

 

Back To Top