From 2c8198f68091d4555457435f09d139c7e9ef7320 Mon Sep 17 00:00:00 2001 From: Michael Ratanapintha <1039862+metathinker@users.noreply.github.com> Date: Tue, 9 Jul 2019 22:42:20 -0700 Subject: [PATCH] Added "Vintage" color scheme to defaults; fixes #1781 Testing done: All manual tests: - Deleted profiles.json, started Terminal. - Verified that the output "Vintage" color scheme existed. - Verified that "Vintage" diffed equal to the "Classic" scheme in the issue, apart from the name and the addition of "background" and "foreground" colors, which I made equal to the "black" and "white" ones respectively. - Verified that I could set a profile to use Vintage and that the colors changed accordingly. --- src/cascadia/TerminalApp/CascadiaSettings.cpp | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/cascadia/TerminalApp/CascadiaSettings.cpp b/src/cascadia/TerminalApp/CascadiaSettings.cpp index 8ab04a06a90..4c4b0545e8e 100644 --- a/src/cascadia/TerminalApp/CascadiaSettings.cpp +++ b/src/cascadia/TerminalApp/CascadiaSettings.cpp @@ -49,6 +49,35 @@ ColorScheme _CreateCampbellScheme() // clang-format off +ColorScheme _CreateVintageScheme() +{ + // as per https://github.com/microsoft/terminal/issues/1781 + ColorScheme vintageScheme { L"Vintage", + RGB(192, 192, 192), + RGB( 0, 0, 0) }; + auto& vintageTable = vintageScheme.GetTable(); + auto vintageSpan = gsl::span(&vintageTable[0], gsl::narrow(COLOR_TABLE_SIZE)); + vintageTable[0] = RGB( 0, 0, 0); // black + vintageTable[1] = RGB(128, 0, 0); // dark red + vintageTable[2] = RGB( 0, 128, 0); // dark green + vintageTable[3] = RGB(128, 128, 0); // dark yellow + vintageTable[4] = RGB( 0, 0, 128); // dark blue + vintageTable[5] = RGB(128, 0, 128); // dark magenta + vintageTable[6] = RGB( 0, 128, 128); // dark cyan + vintageTable[7] = RGB(192, 192, 192); // gray + vintageTable[8] = RGB(128, 128, 128); // dark gray + vintageTable[9] = RGB(255, 0, 0); // red + vintageTable[10] = RGB( 0, 255, 0); // green + vintageTable[11] = RGB(255, 255, 0); // yellow + vintageTable[12] = RGB( 0, 0, 255); // blue + vintageTable[13] = RGB(255, 0, 255); // magenta + vintageTable[14] = RGB( 0, 255, 255); // cyan + vintageTable[15] = RGB(255, 255, 255); // white + Utils::SetColorTableAlpha(vintageSpan, 0xff); + + return vintageScheme; +} + ColorScheme _CreateOneHalfDarkScheme() { // First 8 dark colors per: https://github.com/sonph/onehalf/blob/master/putty/onehalf-dark.reg @@ -179,6 +208,7 @@ ColorScheme _CreateSolarizedLightScheme() void CascadiaSettings::_CreateDefaultSchemes() { _globals.GetColorSchemes().emplace_back(_CreateCampbellScheme()); + _globals.GetColorSchemes().emplace_back(_CreateVintageScheme()); _globals.GetColorSchemes().emplace_back(_CreateOneHalfDarkScheme()); _globals.GetColorSchemes().emplace_back(_CreateOneHalfLightScheme()); _globals.GetColorSchemes().emplace_back(_CreateSolarizedDarkScheme());