Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace color logic with a macro to remove repetition #82

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 21 additions & 19 deletions src/colour.h
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
#define COLOR(BOLD, COLOR) "\033[" #BOLD ";" #COLOR "m"

/* BOLD COLOURS */
#define BBLACK "\033[1;30m"
#define BGRAY "\033[1;90m"
#define BRED "\033[1;31m"
#define BGREEN "\033[1;32m"
#define BYELLOW "\033[1;33m"
#define BBLUE "\033[1;34m"
#define BMAGENTA "\033[1;35m"
#define BCYAN "\033[1;36m"
#define BWHITE "\033[1;37m"
#define BBLACK COLOR(1, 30)
#define BGRAY COLOR(1, 90)
#define BRED COLOR(1, 31)
#define BGREEN COLOR(1, 32)
#define BYELLOW COLOR(1, 33)
#define BBLUE COLOR(1, 34)
#define BMAGENTA COLOR(1, 35)
#define BCYAN COLOR(1, 36)
#define BWHITE COLOR(1, 37)
/* NORMAL COLOURS */
#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 MAGENTA "\033[0;35m"
#define CYAN "\033[0;36m"
#define WHITE "\033[0;37m"
#define BLACK COLOR(0, 30)
#define RED COLOR(0, 31)
#define GREEN COLOR(0, 32)
#define YELLOW COLOR(0, 33)
#define BLUE COLOR(0, 34)
#define MAGENTA COLOR(0, 35)
#define CYAN COLOR(0, 36)
#define WHITE COLOR(0, 37)
/* OTHER */
#define RESET "\033[0;m"
#define BITAL "\033[1;3m"
#define RESET COLOR(0, )
#define BITAL COLOR(0, 3)