reverted to 8-color

This commit is contained in:
Valerie Wolfe 2024-03-21 15:50:55 -04:00
parent db6c081056
commit 204dc5223d
2 changed files with 44 additions and 32 deletions

View file

@ -1,5 +1,5 @@
# Pride! for the tty # Pride! for the tty
A C utility to display flags in 256-color terminals. A C utility to display flags in 8-color terminals.

74
main.c
View file

@ -7,8 +7,22 @@
#define RESET "\x1b[0m" #define RESET "\x1b[0m"
#define COLOR(n) "\x1b[38;5;" #n "m" #define COLOR(n) "\x1b[38;5;" #n "m"
#define BLACK "\x1b[38;5;0m" #define BLACK COLOR(0)
#define WHITE "\x1b[38;5;255m" #define RED COLOR(1)
#define GREEN COLOR(2)
#define YELLOW COLOR(3)
#define BLUE COLOR(4)
#define MAGENTA COLOR(5)
#define CYAN COLOR(6)
#define GRAY COLOR(7)
#define L_BLACK COLOR(8)
#define L_RED COLOR(9)
#define L_GREEN COLOR(10)
#define L_YELLOW COLOR(11)
#define L_BLUE COLOR(12)
#define L_MAGENTA COLOR(13)
#define L_CYAN COLOR(14)
#define WHITE COLOR(15)
#define STRIPE "██████████████████\n" #define STRIPE "██████████████████\n"
@ -59,57 +73,55 @@ int main(int argc, char **argv) {
} }
if(strcmp(flag, RAINBOW) == 0) { // - RAINBOW - if(strcmp(flag, RAINBOW) == 0) { // - RAINBOW -
printf(COLOR(196) STRIPE); // red printf(RED STRIPE);
printf(COLOR(208) STRIPE); // orange printf(L_RED STRIPE);
printf(COLOR(220) STRIPE); // yellow printf(L_YELLOW STRIPE);
printf(COLOR(28) STRIPE); // green printf(GREEN STRIPE);
printf(COLOR(21) STRIPE); // blue printf(BLUE STRIPE);
printf(COLOR(90) STRIPE); // purple printf(MAGENTA STRIPE);
} }
else if(strcmp(flag, AROACE) == 0) { // - ARO/ACE - else if(strcmp(flag, AROACE) == 0) { // - ARO/ACE -
printf(COLOR(172) STRIPE); // orange printf(YELLOW STRIPE);
printf(COLOR(184) STRIPE); // yellow printf(L_YELLOW STRIPE);
printf(WHITE STRIPE); // white printf(WHITE STRIPE);
printf(COLOR(38) STRIPE); // blue printf(L_CYAN STRIPE);
printf(COLOR(17) STRIPE); // navy printf(BLUE STRIPE);
} }
else if(strcmp(flag, BISEXUAL) == 0) { // - BISEXUAL - else if(strcmp(flag, BISEXUAL) == 0) { // - BISEXUAL -
printf(COLOR(161) STRIPE STRIPE); // maroon printf(RED STRIPE STRIPE);
printf(COLOR(91) STRIPE); // purple printf(MAGENTA STRIPE);
printf(COLOR(21) STRIPE STRIPE); // blue printf(BLUE STRIPE STRIPE);
} }
else if(strcmp(flag, LESBIAN) == 0) { // - LESBIAN - else if(strcmp(flag, LESBIAN) == 0) { // - LESBIAN -
printf(COLOR(202) STRIPE); // orange printf(RED STRIPE); // orange
printf(COLOR(209) STRIPE); // tangerine printf(L_RED STRIPE); // tangerine
printf(WHITE STRIPE); // white printf(WHITE STRIPE); // white
printf(COLOR(205) STRIPE); // pink printf(L_MAGENTA STRIPE); // pink
printf(COLOR(161) STRIPE); // magenta printf(MAGENTA STRIPE); // magenta
} }
else if(strcmp(flag, NONBINARY) == 0) { // - NONBINARY - else if(strcmp(flag, NONBINARY) == 0) { // - NONBINARY -
printf(COLOR(226) STRIPE); // yellow printf(L_YELLOW STRIPE); // yellow
printf(WHITE STRIPE); // white printf(WHITE STRIPE); // white
printf(COLOR(134) STRIPE); // purple printf(MAGENTA STRIPE); // purple
printf(BLACK STRIPE); // black printf(BLACK STRIPE); // black
} }
else if(strcmp(flag, PANSEXUAL) == 0) { // - PANSEXUAL - else if(strcmp(flag, PANSEXUAL) == 0) { // - PANSEXUAL -
printf(COLOR(161) STRIPE STRIPE); // magenta printf(MAGENTA STRIPE STRIPE);
printf(COLOR(220) STRIPE STRIPE); // yellow printf(L_YELLOW STRIPE STRIPE);
printf(COLOR(45) STRIPE STRIPE); // cyan printf(CYAN STRIPE STRIPE);
} }
else if(strcmp(flag, TRANSGENDER) == 0) { // - TRANSGENDER - else if(strcmp(flag, TRANSGENDER) == 0) { // - TRANSGENDER -
char *blue = COLOR(45) STRIPE; printf(L_CYAN STRIPE);
char *pink = COLOR(177) STRIPE; printf(L_MAGENTA STRIPE);
printf(blue);
printf(pink);
printf(WHITE STRIPE); printf(WHITE STRIPE);
printf(pink); printf(L_MAGENTA STRIPE);
printf(blue); printf(L_CYAN STRIPE);
} }