/*++ Copyright (c) Microsoft Corporation Licensed under the MIT license. Module Name: - ColorScheme.hpp Abstract: - A color scheme is a single set of colors to use as the terminal colors. These schemes are named, and can be used to quickly change all the colors of the terminal to another scheme. Author(s): - Mike Griese - March 2019 --*/ #pragma once #include #include #include "../../inc/conattrs.hpp" // fwdecl unittest classes namespace TerminalAppLocalTests { class SettingsTests; class ColorSchemeTests; }; namespace TerminalApp { class ColorScheme; }; class TerminalApp::ColorScheme { public: ColorScheme(); ColorScheme(std::wstring name, COLORREF defaultFg, COLORREF defaultBg, COLORREF cursorColor); ~ColorScheme(); void ApplyScheme(winrt::Microsoft::Terminal::Settings::TerminalSettings terminalSettings) const; static ColorScheme FromJson(const Json::Value& json); bool ShouldBeLayered(const Json::Value& json) const; void LayerJson(const Json::Value& json); std::wstring_view GetName() const noexcept; std::array& GetTable() noexcept; COLORREF GetForeground() const noexcept; COLORREF GetBackground() const noexcept; COLORREF GetSelectionBackground() const noexcept; COLORREF GetCursorColor() const noexcept; static std::optional GetNameFromJson(const Json::Value& json); private: std::wstring _schemeName; std::array _table; COLORREF _defaultForeground; COLORREF _defaultBackground; COLORREF _selectionBackground; COLORREF _cursorColor; friend class TerminalAppLocalTests::SettingsTests; friend class TerminalAppLocalTests::ColorSchemeTests; };