forked from Bananymous/banan-os
Kernel/Terminal: Update terminal color themes and fix TTY bright/dark
This commit is contained in:
parent
25a47f0df3
commit
723e458bd7
|
@ -46,21 +46,21 @@ namespace Kernel
|
|||
namespace TerminalColor
|
||||
{
|
||||
static constexpr TerminalDriver::Color BLACK = 0x000000;
|
||||
static constexpr TerminalDriver::Color BLUE = 0x0000AA;
|
||||
static constexpr TerminalDriver::Color GREEN = 0x00AA00;
|
||||
static constexpr TerminalDriver::Color CYAN = 0x00AAAA;
|
||||
static constexpr TerminalDriver::Color RED = 0xAA0000;
|
||||
static constexpr TerminalDriver::Color MAGENTA = 0xAA00AA;
|
||||
static constexpr TerminalDriver::Color YELLOW = 0xAA5500;
|
||||
static constexpr TerminalDriver::Color WHITE = 0xAAAAAA;
|
||||
static constexpr TerminalDriver::Color RED = 0xFF0000;
|
||||
static constexpr TerminalDriver::Color GREEN = 0x00FF00;
|
||||
static constexpr TerminalDriver::Color YELLOW = 0xFFFF00;
|
||||
static constexpr TerminalDriver::Color BLUE = 0x0000FF;
|
||||
static constexpr TerminalDriver::Color MAGENTA = 0xFF00FF;
|
||||
static constexpr TerminalDriver::Color CYAN = 0x00FFFF;
|
||||
static constexpr TerminalDriver::Color WHITE = 0xBFBFBF;
|
||||
|
||||
static constexpr TerminalDriver::Color BRIGHT_BLACK = 0x555555;
|
||||
static constexpr TerminalDriver::Color BRIGHT_BLUE = 0x5555FF;
|
||||
static constexpr TerminalDriver::Color BRIGHT_GREEN = 0x55FF55;
|
||||
static constexpr TerminalDriver::Color BRIGHT_CYAN = 0x55FFFF;
|
||||
static constexpr TerminalDriver::Color BRIGHT_RED = 0xFF5555;
|
||||
static constexpr TerminalDriver::Color BRIGHT_MAGENTA = 0xFF55FF;
|
||||
static constexpr TerminalDriver::Color BRIGHT_YELLOW = 0xFFFF55;
|
||||
static constexpr TerminalDriver::Color BRIGHT_BLACK = 0x3F3F3F;
|
||||
static constexpr TerminalDriver::Color BRIGHT_RED = 0xFF7F7F;
|
||||
static constexpr TerminalDriver::Color BRIGHT_GREEN = 0x7FFF7F;
|
||||
static constexpr TerminalDriver::Color BRIGHT_YELLOW = 0xFFFF7F;
|
||||
static constexpr TerminalDriver::Color BRIGHT_BLUE = 0x7F7FFF;
|
||||
static constexpr TerminalDriver::Color BRIGHT_MAGENTA = 0xFF7FFF;
|
||||
static constexpr TerminalDriver::Color BRIGHT_CYAN = 0x7FFFFF;
|
||||
static constexpr TerminalDriver::Color BRIGHT_WHITE = 0xFFFFFF;
|
||||
}
|
||||
|
||||
|
|
|
@ -115,41 +115,41 @@ namespace Kernel
|
|||
m_background = TerminalColor::BLACK;
|
||||
break;
|
||||
|
||||
case 30: m_foreground = TerminalColor::BRIGHT_BLACK; break;
|
||||
case 31: m_foreground = TerminalColor::BRIGHT_RED; break;
|
||||
case 32: m_foreground = TerminalColor::BRIGHT_GREEN; break;
|
||||
case 33: m_foreground = TerminalColor::BRIGHT_YELLOW; break;
|
||||
case 34: m_foreground = TerminalColor::BRIGHT_BLUE; break;
|
||||
case 35: m_foreground = TerminalColor::BRIGHT_MAGENTA; break;
|
||||
case 36: m_foreground = TerminalColor::BRIGHT_CYAN; break;
|
||||
case 37: m_foreground = TerminalColor::BRIGHT_WHITE; break;
|
||||
case 30: m_foreground = TerminalColor::BLACK; break;
|
||||
case 31: m_foreground = TerminalColor::RED; break;
|
||||
case 32: m_foreground = TerminalColor::GREEN; break;
|
||||
case 33: m_foreground = TerminalColor::YELLOW; break;
|
||||
case 34: m_foreground = TerminalColor::BLUE; break;
|
||||
case 35: m_foreground = TerminalColor::MAGENTA; break;
|
||||
case 36: m_foreground = TerminalColor::CYAN; break;
|
||||
case 37: m_foreground = TerminalColor::WHITE; break;
|
||||
|
||||
case 40: m_background = TerminalColor::BRIGHT_BLACK; break;
|
||||
case 41: m_background = TerminalColor::BRIGHT_RED; break;
|
||||
case 42: m_background = TerminalColor::BRIGHT_GREEN; break;
|
||||
case 43: m_background = TerminalColor::BRIGHT_YELLOW; break;
|
||||
case 44: m_background = TerminalColor::BRIGHT_BLUE; break;
|
||||
case 45: m_background = TerminalColor::BRIGHT_MAGENTA; break;
|
||||
case 46: m_background = TerminalColor::BRIGHT_CYAN; break;
|
||||
case 47: m_background = TerminalColor::BRIGHT_WHITE; break;
|
||||
case 40: m_background = TerminalColor::BLACK; break;
|
||||
case 41: m_background = TerminalColor::RED; break;
|
||||
case 42: m_background = TerminalColor::GREEN; break;
|
||||
case 43: m_background = TerminalColor::YELLOW; break;
|
||||
case 44: m_background = TerminalColor::BLUE; break;
|
||||
case 45: m_background = TerminalColor::MAGENTA; break;
|
||||
case 46: m_background = TerminalColor::CYAN; break;
|
||||
case 47: m_background = TerminalColor::WHITE; break;
|
||||
|
||||
case 90: m_foreground = TerminalColor::BLACK; break;
|
||||
case 91: m_foreground = TerminalColor::RED; break;
|
||||
case 92: m_foreground = TerminalColor::GREEN; break;
|
||||
case 93: m_foreground = TerminalColor::YELLOW; break;
|
||||
case 94: m_foreground = TerminalColor::BLUE; break;
|
||||
case 95: m_foreground = TerminalColor::MAGENTA; break;
|
||||
case 96: m_foreground = TerminalColor::CYAN; break;
|
||||
case 97: m_foreground = TerminalColor::WHITE; break;
|
||||
case 90: m_foreground = TerminalColor::BRIGHT_BLACK; break;
|
||||
case 91: m_foreground = TerminalColor::BRIGHT_RED; break;
|
||||
case 92: m_foreground = TerminalColor::BRIGHT_GREEN; break;
|
||||
case 93: m_foreground = TerminalColor::BRIGHT_YELLOW; break;
|
||||
case 94: m_foreground = TerminalColor::BRIGHT_BLUE; break;
|
||||
case 95: m_foreground = TerminalColor::BRIGHT_MAGENTA; break;
|
||||
case 96: m_foreground = TerminalColor::BRIGHT_CYAN; break;
|
||||
case 97: m_foreground = TerminalColor::BRIGHT_WHITE; break;
|
||||
|
||||
case 100: m_background = TerminalColor::BLACK; break;
|
||||
case 101: m_background = TerminalColor::RED; break;
|
||||
case 102: m_background = TerminalColor::GREEN; break;
|
||||
case 103: m_background = TerminalColor::YELLOW; break;
|
||||
case 104: m_background = TerminalColor::BLUE; break;
|
||||
case 105: m_background = TerminalColor::MAGENTA; break;
|
||||
case 106: m_background = TerminalColor::CYAN; break;
|
||||
case 107: m_background = TerminalColor::WHITE; break;
|
||||
case 100: m_background = TerminalColor::BRIGHT_BLACK; break;
|
||||
case 101: m_background = TerminalColor::BRIGHT_RED; break;
|
||||
case 102: m_background = TerminalColor::BRIGHT_GREEN; break;
|
||||
case 103: m_background = TerminalColor::BRIGHT_YELLOW; break;
|
||||
case 104: m_background = TerminalColor::BRIGHT_BLUE; break;
|
||||
case 105: m_background = TerminalColor::BRIGHT_MAGENTA; break;
|
||||
case 106: m_background = TerminalColor::BRIGHT_CYAN; break;
|
||||
case 107: m_background = TerminalColor::BRIGHT_WHITE; break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -184,26 +184,26 @@ bool Terminal::read_shell()
|
|||
|
||||
void Terminal::handle_sgr()
|
||||
{
|
||||
constexpr uint32_t colors_default[] {
|
||||
0x555555,
|
||||
0xFF5555,
|
||||
0x55FF55,
|
||||
0xFFFF55,
|
||||
0x5555FF,
|
||||
0xFF55FF,
|
||||
0x55FFFF,
|
||||
0xFFFFFF,
|
||||
constexpr uint32_t colors_dark[] {
|
||||
0xFF'000000,
|
||||
0xFF'FF0000,
|
||||
0xFF'00FF00,
|
||||
0xFF'FFFF00,
|
||||
0xFF'0000FF,
|
||||
0xFF'FF00FF,
|
||||
0xFF'00FFFF,
|
||||
0xFF'BFBFBF,
|
||||
};
|
||||
|
||||
constexpr uint32_t colors_bright[] {
|
||||
0xAAAAAA,
|
||||
0xFFAAAA,
|
||||
0xAAFFAA,
|
||||
0xFFFFAA,
|
||||
0xAAAAFF,
|
||||
0xFFAAFF,
|
||||
0xAAFFFF,
|
||||
0xFFFFFF,
|
||||
0xFF'3F3F3F,
|
||||
0xFF'FF7F7F,
|
||||
0xFF'7FFF7F,
|
||||
0xFF'FFFF7F,
|
||||
0xFF'7F7FFF,
|
||||
0xFF'FF7FFF,
|
||||
0xFF'7FFFFF,
|
||||
0xFF'FFFFFF,
|
||||
};
|
||||
|
||||
switch (m_csi_info.fields[0])
|
||||
|
@ -213,10 +213,10 @@ void Terminal::handle_sgr()
|
|||
m_bg_color = 0x000000;
|
||||
break;
|
||||
case 30: case 31: case 32: case 33: case 34: case 35: case 36: case 37:
|
||||
m_fg_color = colors_default[m_csi_info.fields[0] - 30];
|
||||
m_fg_color = colors_dark[m_csi_info.fields[0] - 30];
|
||||
break;
|
||||
case 40: case 41: case 42: case 43: case 44: case 45: case 46: case 47:
|
||||
m_bg_color = colors_default[m_csi_info.fields[0] - 40];
|
||||
m_bg_color = colors_dark[m_csi_info.fields[0] - 40];
|
||||
break;
|
||||
case 90: case 91: case 92: case 93: case 94: case 95: case 96: case 97:
|
||||
m_fg_color = colors_bright[m_csi_info.fields[0] - 90];
|
||||
|
|
Loading…
Reference in New Issue