Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- //C Colours .h
- //Effects: if the previos color setting isnt cleared, you get combined effects
- //Clear as in Reset the color to system setting, not as in the color clear
- #define CLEAR "\033[0m"
- //double underscore
- #define UNDERLINE_2 "\033[0;21m"
- //text colorized
- #define BLACK "\033[0;30m"
- #define RED "\033[0;31m"
- #define GREEN "\033[0;32m"
- #define YELLOW "\033[0;33m"
- #define BLUE "\033[0;34m"
- #define PURPLE "\033[0;35m"
- #define CYAN "\033[0;36m"
- #define WHITE "\033[0;37m"
- //text is system color, highlighted in color
- #define HIGHLIGHT_BLACK "\033[0;40m"
- #define HIGHLIGHT_RED "\033[0;41m"
- #define HIGHLIGHT_GREEN "\033[0;42m"
- #define HIGHLIGHT_YELLOW "\033[0;43m"
- #define HIGHLIGHT_BLUE "\033[0;44m"
- #define HIGHLIGHT_PURPLE "\033[0;45m"
- #define HIGHLIGHT_CYAN "\033[0;46m"
- #define HIGHLIGHT_WHITE "\033[0;47m"
- //single underscore
- #define UNDERLINE "\033[0;52m"
- #define BLACK_BOLD "\033[1;90m"
- #define RED_BOLD "\033[1;91m"
- #define GREEN_BOLD "\033[1;92m"
- #define YELLOW_BOLD "\033[1;93m"
- #define BLUE_BOLD "\033[1;94m"
- #define PURPLE_BOLD "\033[1;95m"
- #define CYAN_BOLD "\033[1;96m"
- #define WHITE_BOLD "\033[1;97m"
- int main(){
- char *a[27]={
- CLEAR, UNDERLINE_2, BLACK, RED, GREEN, YELLOW, BLUE, PURPLE, CYAN, WHITE,
- HIGHLIGHT_BLACK, HIGHLIGHT_RED, HIGHLIGHT_GREEN, HIGHLIGHT_YELLOW,
- HIGHLIGHT_BLUE, HIGHLIGHT_PURPLE,HIGHLIGHT_CYAN, HIGHLIGHT_WHITE,
- BLACK_BOLD, RED_BOLD, GREEN_BOLD, YELLOW_BOLD, BLUE_BOLD, PURPLE_BOLD,
- CYAN_BOLD, WHITE_BOLD, UNDERLINE
- };
- printf(RED);
- printf("Lib Color\n");
- printf(CLEAR);
- for (int i=10; i<14; i++){
- printf("%s",a[i]);
- printf("\nHello world\n");
- printf("%s",a[0]);
- }
- //Red on Red
- printf(RED_BOLD);
- printf("TEXT LOL");
- printf(CLEAR);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement