Compare commits

...

1 Commits

Author SHA1 Message Date
Leonard Hecker
0a8ef83dd2 Default to Ottosson 2026-02-24 16:52:43 +01:00
11 changed files with 42 additions and 40 deletions

View File

@@ -302,12 +302,12 @@
"description": "Contains both a light and dark color scheme for the Terminal to use, depending on the theme of the application.",
"properties": {
"light": {
"default": "Campbell",
"default": "Ottosson",
"description": "Name of the scheme to use when the app is using light theme",
"type": "string"
},
"dark": {
"default": "Campbell",
"default": "Ottosson",
"description": "Name of the scheme to use when the app is using dark theme",
"type": "string"
}
@@ -2860,7 +2860,7 @@
]
},
"colorScheme": {
"default": "Campbell",
"default": "Ottosson",
"description": "Name of the terminal color scheme to use. Color schemes are defined under \"schemes\".",
"oneOf": [
{

View File

@@ -35,8 +35,8 @@ namespace winrt::SampleApp::implementation
MySettings()
{
const auto campbellSpan = ::Microsoft::Console::Utils::CampbellColorTable();
std::transform(campbellSpan.begin(), campbellSpan.end(), _ColorTable.begin(), [](auto&& color) {
const auto s = ::Microsoft::Console::Utils::DefaultColorTable();
std::transform(s.begin(), s.end(), _ColorTable.begin(), [](auto&& color) {
return static_cast<winrt::Microsoft::Terminal::Core::Color>(til::color{ color });
});
}

View File

@@ -433,8 +433,8 @@ namespace winrt::Microsoft::Terminal::Settings
}
else
{
const auto campbellSpan = CampbellColorTable();
std::transform(campbellSpan.begin(), campbellSpan.end(), colorTable.begin(), [](auto&& color) {
const auto s = DefaultColorTable();
std::transform(s.begin(), s.end(), colorTable.begin(), [](auto&& color) {
return static_cast<winrt::Microsoft::Terminal::Core::Color>(til::color{ color });
});
span = colorTable;

View File

@@ -167,8 +167,8 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
// Delete scheme from settings model
_settings.GlobalSettings().RemoveColorScheme(name);
// This ensures that the JSON is updated with "Campbell", because the color scheme was deleted
_settings.UpdateColorSchemeReferences(name, L"Campbell");
// This ensures that the JSON is updated with "Ottosson", because the color scheme was deleted
_settings.UpdateColorSchemeReferences(name, L"Ottosson");
// If we're not on this page, switch back to this page
if (CurrentPage() != ColorSchemesSubPage::Base)

View File

@@ -44,8 +44,8 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
INHERITABLE_NULLABLE_SETTING(Model::IAppearanceConfig, Microsoft::Terminal::Core::Color, CursorColor, nullptr);
INHERITABLE_SETTING(Model::IAppearanceConfig, float, Opacity, 1.0f);
INHERITABLE_SETTING(Model::IAppearanceConfig, hstring, DarkColorSchemeName, L"Campbell");
INHERITABLE_SETTING(Model::IAppearanceConfig, hstring, LightColorSchemeName, L"Campbell");
INHERITABLE_SETTING(Model::IAppearanceConfig, hstring, DarkColorSchemeName, L"Ottosson");
INHERITABLE_SETTING(Model::IAppearanceConfig, hstring, LightColorSchemeName, L"Ottosson");
#define APPEARANCE_SETTINGS_INITIALIZE(type, name, jsonKey, ...) \
INHERITABLE_SETTING(Model::IAppearanceConfig, type, name, ##__VA_ARGS__)

View File

@@ -55,7 +55,7 @@ ColorScheme::ColorScheme(const winrt::hstring& name) noexcept :
_Name{ name },
_Origin{ OriginTag::User }
{
const auto table = Utils::CampbellColorTable();
const auto table = Utils::DefaultColorTable();
std::copy_n(table.data(), table.size(), _table.data());
}

View File

@@ -330,8 +330,6 @@ void PowershellCoreProfileGenerator::GenerateProfiles(std::vector<winrt::com_ptr
profile->Commandline(winrt::hstring{ quotedCommandline });
profile->StartingDirectory(winrt::hstring{ DEFAULT_STARTING_DIRECTORY });
profile->DefaultAppearance().DarkColorSchemeName(L"Campbell");
profile->DefaultAppearance().LightColorSchemeName(L"Campbell");
profile->Icon(winrt::hstring{ WI_IsFlagSet(psI.flags, PowerShellFlags::Preview) ? POWERSHELL_PREVIEW_ICON : POWERSHELL_ICON });
if (first)

View File

@@ -67,8 +67,6 @@ static winrt::com_ptr<implementation::Profile> makeProfile(const std::wstring& d
std::wstring command{};
THROW_IF_FAILED(wil::GetSystemDirectoryW<std::wstring>(command));
WSLDistro->Commandline(winrt::hstring{ command + L"\\wsl.exe -d " + distName });
WSLDistro->DefaultAppearance().DarkColorSchemeName(L"Campbell");
WSLDistro->DefaultAppearance().LightColorSchemeName(L"Campbell");
if (isWslDashDashCdAvailableForLinuxPaths())
{
WSLDistro->StartingDirectory(winrt::hstring{ WslHomeDirectory });

View File

@@ -40,7 +40,6 @@
"name": "Windows PowerShell",
"commandline": "%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
"icon": "ms-appx:///ProfileIcons/{61c54bbd-c2c6-5271-96e7-009a87ff44bf}.png",
"colorScheme": "Campbell",
"antialiasingMode": "grayscale",
"closeOnExit": "automatic",
"cursorShape": "bar",
@@ -59,7 +58,6 @@
"name": "Command Prompt",
"commandline": "%SystemRoot%\\System32\\cmd.exe",
"icon": "ms-appx:///ProfileIcons/{0caa0dad-35be-5f56-a8ff-afceeeaa6101}.png",
"colorScheme": "Campbell",
"antialiasingMode": "grayscale",
"closeOnExit": "automatic",
"cursorShape": "bar",
@@ -106,7 +104,7 @@
{
"name": "Ottosson",
"background": "#000000",
"foreground": "#bebebe",
"foreground": "#ffffff",
"cursorColor": "#ffffff",
"selectionBackground": "#92a4fd",
"black": "#000000",

View File

@@ -8,23 +8,23 @@
using namespace Microsoft::Console;
using namespace std::string_view_literals;
static constexpr std::array<til::color, 16> campbellColorTable{
til::color{ 0x0C, 0x0C, 0x0C },
til::color{ 0xC5, 0x0F, 0x1F },
til::color{ 0x13, 0xA1, 0x0E },
til::color{ 0xC1, 0x9C, 0x00 },
til::color{ 0x00, 0x37, 0xDA },
til::color{ 0x88, 0x17, 0x98 },
til::color{ 0x3A, 0x96, 0xDD },
til::color{ 0xCC, 0xCC, 0xCC },
til::color{ 0x76, 0x76, 0x76 },
til::color{ 0xE7, 0x48, 0x56 },
til::color{ 0x16, 0xC6, 0x0C },
til::color{ 0xF9, 0xF1, 0xA5 },
til::color{ 0x3B, 0x78, 0xFF },
til::color{ 0xB4, 0x00, 0x9E },
til::color{ 0x61, 0xD6, 0xD6 },
til::color{ 0xF2, 0xF2, 0xF2 },
static constexpr std::array<til::color, 16> defaultColorTable{
til::color{ 0x00, 0x00, 0x00, },
til::color{ 0xbe, 0x2c, 0x21, },
til::color{ 0x3f, 0xae, 0x3a, },
til::color{ 0xbe, 0x9a, 0x4a, },
til::color{ 0x20, 0x4d, 0xbe, },
til::color{ 0xbb, 0x54, 0xbe, },
til::color{ 0x00, 0xa7, 0xb2, },
til::color{ 0xbe, 0xbe, 0xbe, },
til::color{ 0x80, 0x80, 0x80, },
til::color{ 0xff, 0x3e, 0x30, },
til::color{ 0x58, 0xea, 0x51, },
til::color{ 0xff, 0xc9, 0x44, },
til::color{ 0x2f, 0x6a, 0xff, },
til::color{ 0xfc, 0x74, 0xff, },
til::color{ 0x00, 0xe1, 0xf0, },
til::color{ 0xff, 0xff, 0xff, },
};
static constexpr std::array<til::color, 16> vt340ColorTable{
@@ -214,9 +214,9 @@ static constexpr til::presorted_static_map xorgAppColorTable{
std::pair{ "yellowgreen"sv, til::color{ 154, 205, 50 } }
};
std::span<const til::color> Utils::CampbellColorTable() noexcept
std::span<const til::color> Utils::DefaultColorTable() noexcept
{
return std::span{ campbellColorTable };
return std::span{ defaultColorTable };
}
// Function Description:
@@ -233,9 +233,9 @@ void Utils::InitializeColorTable(const std::span<COLORREF> table) noexcept
void Utils::InitializeANSIColorTable(const std::span<COLORREF> table) noexcept
{
if (table.size() >= campbellColorTable.size())
if (table.size() >= defaultColorTable.size())
{
std::copy_n(campbellColorTable.begin(), campbellColorTable.size(), table.begin());
std::copy_n(defaultColorTable.begin(), defaultColorTable.size(), table.begin());
}
}

View File

@@ -16,7 +16,15 @@ namespace Microsoft::Console::Utils
void InitializeANSIColorTable(const std::span<COLORREF> table) noexcept;
void InitializeVT340ColorTable(const std::span<COLORREF> table) noexcept;
void InitializeExtendedColorTable(const std::span<COLORREF> table, const bool monochrome = false) noexcept;
<<<<<<< Updated upstream
std::span<const til::color> CampbellColorTable() noexcept;
||||||| Stash base
void InitializeExtendedColorTableDynamic(std::span<COLORREF> table, COLORREF defaultBackground, COLORREF defaultForeground) noexcept;
std::span<const til::color> CampbellColorTable() noexcept;
=======
void InitializeExtendedColorTableDynamic(std::span<COLORREF> table, COLORREF defaultBackground, COLORREF defaultForeground) noexcept;
std::span<const til::color> DefaultColorTable() noexcept;
>>>>>>> Stashed changes
std::optional<til::color> ColorFromXOrgAppColorName(const std::wstring_view wstr) noexcept;
}