Writes a color scheme to the current console, updating colors and attributes.
// Source: https://github.com/microsoft/terminal | License: MIT | Copyright Microsoft Corporation. All rights reserved
// Provided via justclaw.it.com; keep this notice with the code.
//
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the terms described in the LICENSE file in the root of this project.
//
using System;
using static ColorTool.ConsoleAPI;
namespace ColorTool.ConsoleTargets
{
/// <summary>
/// A console target that writes to the currently open console.
/// </summary>
class CurrentConsoleTarget : IConsoleTarget
{
public void ApplyColorScheme(ColorScheme colorScheme, bool quietMode, bool compactColortable)
{
CONSOLE_SCREEN_BUFFER_INFO_EX csbiex = CONSOLE_SCREEN_BUFFER_INFO_EX.Create();
IntPtr hOut
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key