Add one half color schemes (#466)
* Add One Half Dark & Light color schemes * WIP: Add One Half Dark/Lite schemes to settings * Address PR feedback - use gsl::narrow() * Fix reversed OneHalfLight fg/bg colors Added in customized colortool scheme colors for last 8 colors
This commit is contained in:
parent
639d5f3f93
commit
71229239d4
|
@ -38,9 +38,69 @@ ColorScheme _CreateCampbellScheme()
|
|||
return campbellScheme;
|
||||
}
|
||||
|
||||
ColorScheme _CreateOneHalfDarkScheme()
|
||||
{
|
||||
// First 8 dark colors per: https://github.com/sonph/onehalf/blob/master/putty/onehalf-dark.reg
|
||||
// Dark gray is per colortool scheme, the other 7 of the last 8 colors from the colortool
|
||||
// scheme are the same as their dark color equivalents.
|
||||
ColorScheme oneHalfDarkScheme { L"One Half Dark",
|
||||
RGB(220, 223, 228),
|
||||
RGB( 40, 44, 52) };
|
||||
auto& oneHalfDarkTable = oneHalfDarkScheme.GetTable();
|
||||
auto oneHalfDarkSpan = gsl::span<COLORREF>(&oneHalfDarkTable[0], gsl::narrow<ptrdiff_t>(COLOR_TABLE_SIZE));
|
||||
oneHalfDarkTable[0] = RGB( 40, 44, 52); // black
|
||||
oneHalfDarkTable[1] = RGB(224, 108, 117); // dark red
|
||||
oneHalfDarkTable[2] = RGB(152, 195, 121); // dark green
|
||||
oneHalfDarkTable[3] = RGB(229, 192, 123); // dark yellow
|
||||
oneHalfDarkTable[4] = RGB( 97, 175, 239); // dark blue
|
||||
oneHalfDarkTable[5] = RGB(198, 120, 221); // dark magenta
|
||||
oneHalfDarkTable[6] = RGB( 86, 182, 194); // dark cyan
|
||||
oneHalfDarkTable[7] = RGB(220, 223, 228); // gray
|
||||
oneHalfDarkTable[8] = RGB( 90, 99, 116); // dark gray
|
||||
oneHalfDarkTable[9] = RGB(224, 108, 117); // red
|
||||
oneHalfDarkTable[10] = RGB(152, 195, 121); // green
|
||||
oneHalfDarkTable[11] = RGB(229, 192, 123); // yellow
|
||||
oneHalfDarkTable[12] = RGB( 97, 175, 239); // blue
|
||||
oneHalfDarkTable[13] = RGB(198, 120, 221); // magenta
|
||||
oneHalfDarkTable[14] = RGB( 86, 182, 194); // cyan
|
||||
oneHalfDarkTable[15] = RGB(220, 223, 228); // white
|
||||
Microsoft::Console::Utils::SetColorTableAlpha(oneHalfDarkSpan, 0xff);
|
||||
|
||||
return oneHalfDarkScheme;
|
||||
}
|
||||
|
||||
ColorScheme _CreateOneHalfLightScheme()
|
||||
{
|
||||
// First 8 dark colors per: https://github.com/sonph/onehalf/blob/master/putty/onehalf-light.reg
|
||||
// Last 8 colors per colortool scheme.
|
||||
ColorScheme oneHalfLightScheme { L"One Half Light",
|
||||
RGB(56, 58, 66),
|
||||
RGB(250, 250, 250) };
|
||||
auto& oneHalfLightTable = oneHalfLightScheme.GetTable();
|
||||
auto oneHalfLightSpan = gsl::span<COLORREF>(&oneHalfLightTable[0], gsl::narrow<ptrdiff_t>(COLOR_TABLE_SIZE));
|
||||
oneHalfLightTable[0] = RGB( 56, 58, 66); // black
|
||||
oneHalfLightTable[1] = RGB(228, 86, 73); // dark red
|
||||
oneHalfLightTable[2] = RGB( 80, 161, 79); // dark green
|
||||
oneHalfLightTable[3] = RGB(193, 131, 1); // dark yellow
|
||||
oneHalfLightTable[4] = RGB( 1, 132, 188); // dark blue
|
||||
oneHalfLightTable[5] = RGB(166, 38, 164); // dark magenta
|
||||
oneHalfLightTable[6] = RGB( 9, 151, 179); // dark cyan
|
||||
oneHalfLightTable[7] = RGB(250, 250, 250); // gray
|
||||
oneHalfLightTable[8] = RGB( 79, 82, 93); // dark gray
|
||||
oneHalfLightTable[9] = RGB(223, 108, 117); // red
|
||||
oneHalfLightTable[10] = RGB(152, 195, 121); // green
|
||||
oneHalfLightTable[11] = RGB(228, 192, 122); // yellow
|
||||
oneHalfLightTable[12] = RGB( 97, 175, 239); // blue
|
||||
oneHalfLightTable[13] = RGB(197, 119, 221); // magenta
|
||||
oneHalfLightTable[14] = RGB( 86, 181, 193); // cyan
|
||||
oneHalfLightTable[15] = RGB(255, 255, 255); // white
|
||||
Microsoft::Console::Utils::SetColorTableAlpha(oneHalfLightSpan, 0xff);
|
||||
|
||||
return oneHalfLightScheme;
|
||||
}
|
||||
|
||||
ColorScheme _CreateSolarizedDarkScheme()
|
||||
{
|
||||
|
||||
ColorScheme solarizedDarkScheme { L"Solarized Dark",
|
||||
RGB(253, 246, 227),
|
||||
RGB( 7, 54, 66) };
|
||||
|
@ -97,8 +157,8 @@ ColorScheme _CreateSolarizedLightScheme()
|
|||
|
||||
// Method Description:
|
||||
// - Create the set of schemes to use as the default schemes. Currently creates
|
||||
// three default color schemes - Campbell (the new cmd color scheme),
|
||||
// Solarized Dark and Solarized Light.
|
||||
// five default color schemes - Campbell (the new cmd color scheme),
|
||||
// One Half Dark, One Half Light, Solarized Dark, and Solarized Light.
|
||||
// Arguments:
|
||||
// - <none>
|
||||
// Return Value:
|
||||
|
@ -106,6 +166,8 @@ ColorScheme _CreateSolarizedLightScheme()
|
|||
void CascadiaSettings::_CreateDefaultSchemes()
|
||||
{
|
||||
_globals.GetColorSchemes().emplace_back(_CreateCampbellScheme());
|
||||
_globals.GetColorSchemes().emplace_back(_CreateOneHalfDarkScheme());
|
||||
_globals.GetColorSchemes().emplace_back(_CreateOneHalfLightScheme());
|
||||
_globals.GetColorSchemes().emplace_back(_CreateSolarizedDarkScheme());
|
||||
_globals.GetColorSchemes().emplace_back(_CreateSolarizedLightScheme());
|
||||
}
|
||||
|
@ -394,7 +456,7 @@ std::wstring CascadiaSettings::ExpandEnvironmentVariableString(std::wstring_view
|
|||
do
|
||||
{
|
||||
result.resize(requiredSize);
|
||||
requiredSize = ::ExpandEnvironmentStringsW(source.data(), result.data(), static_cast<DWORD>(result.size()));
|
||||
requiredSize = ::ExpandEnvironmentStringsW(source.data(), result.data(), gsl::narrow<DWORD>(result.size()));
|
||||
} while (requiredSize != result.size());
|
||||
|
||||
// Trim the terminating null character
|
||||
|
|
Loading…
Reference in a new issue