dd5dbb2a40
- Implements the Delta E algorithm - Uses the Delta E algorithm to precalculate adjusted foreground values based on possible foreground/background color pairs in the color table - Adds a setting to use the adjusted foreground values when applicable ## PR Checklist * [x] Closes #2638 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [ ] Tests added/passed * [ ] Documentation updated. If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx * [ ] Schema updated. * [x] I work here ## Validation Steps Performed Before: <img width="759" alt="color before" src="https://user-images.githubusercontent.com/26824113/131576768-b3b9eebd-5933-45de-8da8-88a985070312.png"> After (note dark blue): <img width="760" alt="color after" src="https://user-images.githubusercontent.com/26824113/133158807-4e63198f-8a49-4d03-914e-55a5ad57d725.png">
73 lines
2.2 KiB
Plaintext
73 lines
2.2 KiB
Plaintext
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT license.
|
|
|
|
namespace Microsoft.Terminal.Core
|
|
{
|
|
enum CursorStyle
|
|
{
|
|
Vintage,
|
|
Bar,
|
|
Underscore,
|
|
DoubleUnderscore,
|
|
FilledBox,
|
|
EmptyBox
|
|
};
|
|
|
|
// TerminalCore declares its own Color struct to avoid depending
|
|
// on Windows.UI.Color and to avoid passing around unclothed uint32s.
|
|
// It is supported by til::color for conversions in and out of WinRT land.
|
|
struct Color
|
|
{
|
|
UInt8 R;
|
|
UInt8 G;
|
|
UInt8 B;
|
|
UInt8 A;
|
|
};
|
|
|
|
// TerminalCore declares its own Color struct to avoid depending on
|
|
// Windows.UI. Windows.Foundation.Point also exists, but it's composed of
|
|
// floating-point coordinates, when we almost always need integer coordinates.
|
|
// It is supported by til::point for conversions in and out of WinRT land.
|
|
struct Point
|
|
{
|
|
Int32 X;
|
|
Int32 Y;
|
|
};
|
|
|
|
// Same thing here, but with padding. Can't use Windows.UI.Thickness, so
|
|
// we'll declare our own.
|
|
struct Padding {
|
|
Double Left;
|
|
Double Top;
|
|
Double Right;
|
|
Double Bottom;
|
|
};
|
|
|
|
// This is a projection of Microsoft::Terminal::Core::ControlKeyStates,
|
|
// for conversions in and out of WinRT land.
|
|
struct ControlKeyStates
|
|
{
|
|
UInt32 Value;
|
|
};
|
|
|
|
declare
|
|
{
|
|
// Forward declare this parameterized specialization so that it lives
|
|
// in TerminalCore instead of being flung to the winds of all IDL dependents.
|
|
interface Windows.Foundation.IReference<Microsoft.Terminal.Core.Color>;
|
|
interface Windows.Foundation.IReference<Microsoft.Terminal.Core.Point>;
|
|
}
|
|
|
|
interface ICoreAppearance
|
|
{
|
|
Microsoft.Terminal.Core.Color DefaultForeground;
|
|
Microsoft.Terminal.Core.Color DefaultBackground;
|
|
Microsoft.Terminal.Core.Color GetColorTableEntry(Int32 index);
|
|
Microsoft.Terminal.Core.Color CursorColor;
|
|
CursorStyle CursorShape;
|
|
UInt32 CursorHeight;
|
|
Boolean IntenseIsBright;
|
|
Boolean AdjustIndistinguishableColors;
|
|
};
|
|
}
|