printf color code macros
This commit is contained in:
parent
0756b51950
commit
791ffe8633
@ -89,8 +89,7 @@ void __kprint(u8 n, kp_fmt* formats, __kp_value_union* objects){
|
||||
#include <windows.h>
|
||||
#define FOREGROUND_YELLOW FOREGROUND_GREEN | FOREGROUND_RED
|
||||
|
||||
DWORD kp_fgColor_toWin(kp_fgColor f){
|
||||
//kprintf("fg: %x\n", f);
|
||||
DWORD kp_fgColor_toWin(kp_fgColor f){
|
||||
switch(f){
|
||||
case kp_fgBlack: return 0;
|
||||
case kp_fgRedD: return FOREGROUND_RED;
|
||||
@ -112,8 +111,7 @@ DWORD kp_fgColor_toWin(kp_fgColor f){
|
||||
}
|
||||
}
|
||||
|
||||
DWORD kp_bgColor_toWin(kp_bgColor f){
|
||||
//kprintf("bg: %x\n", f);
|
||||
DWORD kp_bgColor_toWin(kp_bgColor f){
|
||||
switch(f){
|
||||
case kp_bgBlack: return 0;
|
||||
case kp_bgRedD: return BACKGROUND_RED;
|
||||
|
||||
@ -4,6 +4,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../base/type_system/typedef_macros.h"
|
||||
|
||||
// 10000000 00000000 00000000 00000000
|
||||
// ^ ^^^^
|
||||
// | color num
|
||||
|
||||
@ -9,6 +9,49 @@ extern "C" {
|
||||
// cross-platform printf analog
|
||||
void kprintf(const char* format, ...);
|
||||
|
||||
// printf format terminal color sequence
|
||||
#define _PRINTF_COLOR(N) "\e["#N"m"
|
||||
|
||||
// foreground dark color codes
|
||||
#define FBLK _PRINTF_COLOR(30)
|
||||
#define FREDD _PRINTF_COLOR(31)
|
||||
#define FGRND _PRINTF_COLOR(32)
|
||||
#define FYELD _PRINTF_COLOR(33)
|
||||
#define FBLUD _PRINTF_COLOR(34)
|
||||
#define FMAGD _PRINTF_COLOR(35)
|
||||
#define FCYND _PRINTF_COLOR(36)
|
||||
#define FGRY _PRINTF_COLOR(37)
|
||||
|
||||
// foreground bright color codes
|
||||
#define FGRYD _PRINTF_COLOR(90)
|
||||
#define FRED _PRINTF_COLOR(91)
|
||||
#define FGRN _PRINTF_COLOR(92)
|
||||
#define FYEL _PRINTF_COLOR(93)
|
||||
#define FBLU _PRINTF_COLOR(94)
|
||||
#define FMAG _PRINTF_COLOR(95)
|
||||
#define FCYN _PRINTF_COLOR(96)
|
||||
#define FWHI _PRINTF_COLOR(97)
|
||||
|
||||
// background dark color codes
|
||||
#define BBLK _PRINTF_COLOR(40)
|
||||
#define BREDD _PRINTF_COLOR(41)
|
||||
#define BGRND _PRINTF_COLOR(42)
|
||||
#define BYELD _PRINTF_COLOR(43)
|
||||
#define BBLUD _PRINTF_COLOR(44)
|
||||
#define BMAGD _PRINTF_COLOR(45)
|
||||
#define BCYND _PRINTF_COLOR(46)
|
||||
#define BGRY _PRINTF_COLOR(47)
|
||||
|
||||
// background bright color codes
|
||||
#define BGRYD _PRINTF_COLOR(100)
|
||||
#define BRED _PRINTF_COLOR(101)
|
||||
#define BGRN _PRINTF_COLOR(102)
|
||||
#define BYEL _PRINTF_COLOR(103)
|
||||
#define BBLU _PRINTF_COLOR(104)
|
||||
#define BMAG _PRINTF_COLOR(105)
|
||||
#define BCYN _PRINTF_COLOR(106)
|
||||
#define BWHI _PRINTF_COLOR(107)
|
||||
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
Loading…
Reference in New Issue
Block a user