-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document the color header and include it in the reference
- Loading branch information
Showing
6 changed files
with
67 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Counting arguments | ||
|
||
:::{doxygenfile} arg_count.h | ||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Terminal colors | ||
|
||
:::{doxygenfile} color.h | ||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Fold | ||
|
||
:::{doxygenfile} fold.h | ||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,8 @@ | |
|
||
:::{toctree} | ||
token | ||
arg_count | ||
fold | ||
color | ||
log | ||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,59 @@ | ||
#pragma once | ||
|
||
/** | ||
* @file | ||
* | ||
*/ | ||
|
||
#include "blackmagic/token.h" // STRINGIZE | ||
#include "blackmagic/fold.h" // FOLD | ||
|
||
/** @name Font style */ | ||
///@{ | ||
/** | ||
* Reset font style. | ||
* A color sequence with only `NORMAL` resets all style, color and background color | ||
*/ | ||
#define NORMAL 0 | ||
#define BOLD 1 | ||
#define DIM 2 | ||
#define ITALIC 3 | ||
#define UNDERLINED 4 | ||
#define NEGATIVE 6 | ||
#define BOLD 1 /**< . */ | ||
#define DIM 2 /**< . */ | ||
#define ITALIC 3 /**< . */ | ||
#define UNDERLINED 4 /**< . */ | ||
#define NEGATIVE 6 /**< . */ | ||
///@} | ||
|
||
#define BLACK 30 | ||
#define RED 31 | ||
#define GREEN 32 | ||
#define YELLOW 33 | ||
#define BLUE 34 | ||
#define PURPLE 35 | ||
#define CYAN 36 | ||
#define LIGHT_GREY 37 | ||
#define DEFAULT 39 | ||
#define WHITE 97 | ||
/** @name Font color */ | ||
///@{ | ||
#define BLACK 30 /**< . */ | ||
#define RED 31 /**< . */ | ||
#define GREEN 32 /**< . */ | ||
#define YELLOW 33 /**< . */ | ||
#define BLUE 34 /**< . */ | ||
#define PURPLE 35 /**< . */ | ||
#define CYAN 36 /**< . */ | ||
#define LIGHT_GREY 37 /**< . */ | ||
#define DEFAULT 39 /**< Reset font color */ | ||
#define WHITE 97 /**< . */ | ||
///@} | ||
|
||
#define BG_BLACK 40 | ||
#define BG_RED 41 | ||
#define BG_GREEN 42 | ||
#define BG_YELLOW 43 | ||
#define BG_BLUE 44 | ||
#define BG_PURPLE 45 | ||
#define BG_CYAN 46 | ||
#define BG_LIGHT_GREY 47 | ||
#define BG_DEFAULT 49 | ||
#define BG_WHITE 107 | ||
/** @name Background color */ | ||
///@{ | ||
#define BG_BLACK 40 /**< . */ | ||
#define BG_RED 41 /**< . */ | ||
#define BG_GREEN 42 /**< . */ | ||
#define BG_YELLOW 43 /**< . */ | ||
#define BG_BLUE 44 /**< . */ | ||
#define BG_PURPLE 45 /**< . */ | ||
#define BG_CYAN 46 /**< . */ | ||
#define BG_LIGHT_GREY 47 /**< . */ | ||
#define BG_DEFAULT 49 /**< Reset background color */ | ||
#define BG_WHITE 107 /**< . */ | ||
///@} | ||
|
||
#define COLOR_JOIN(A, B) A;B | ||
/** | ||
* Expands to a string literal containig an escape code setting the terminal color. | ||
* @since 0.1 | ||
*/ | ||
#define COLOR(...) STRINGIZE(\e[FOLD(COLOR_JOIN __VA_OPT__(,) __VA_ARGS__)m) | ||
|
||
#define COLOR_JOIN(A, B) A;B |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters