commit 1be2939f257bc89136bd6ea2ee04cdf75d12f3f0 Author: Gilles Khouzam Date: Fri Aug 11 16:35:53 2017 -0700 Population of the console repository with the ColorTool diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..ff1b97869c --- /dev/null +++ b/.gitignore @@ -0,0 +1,253 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml +*.exe diff --git a/README.md b/README.md new file mode 100644 index 0000000000..b4516d98c4 --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +# Console + +This is the Official Windows Console Github Repo. +Here you'll find assorted console tools in the `tools/` directory, such as the + [ColorTool](https://github.com/Microsoft/Console/tree/master/tools/ColorTool). + +## Issues + +We will be monitoring and responding to issues as best we can. +Please attempt to avoid filing duplicates of open or closed items when possible. diff --git a/tools/ColorTool/ColorTool.sln b/tools/ColorTool/ColorTool.sln new file mode 100644 index 0000000000..4e8aa959d5 --- /dev/null +++ b/tools/ColorTool/ColorTool.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26228.12 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ColorTool", "ColorTool\ColorTool.csproj", "{97F4550F-5775-4E40-8ECF-A03479884120}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {97F4550F-5775-4E40-8ECF-A03479884120}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {97F4550F-5775-4E40-8ECF-A03479884120}.Debug|Any CPU.Build.0 = Debug|Any CPU + {97F4550F-5775-4E40-8ECF-A03479884120}.Release|Any CPU.ActiveCfg = Release|Any CPU + {97F4550F-5775-4E40-8ECF-A03479884120}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/tools/ColorTool/ColorTool/App.config b/tools/ColorTool/ColorTool/App.config new file mode 100644 index 0000000000..9d2c7adf3b --- /dev/null +++ b/tools/ColorTool/ColorTool/App.config @@ -0,0 +1,6 @@ + + + + + + diff --git a/tools/ColorTool/ColorTool/ColorTool.csproj b/tools/ColorTool/ColorTool/ColorTool.csproj new file mode 100644 index 0000000000..4592e70a67 --- /dev/null +++ b/tools/ColorTool/ColorTool/ColorTool.csproj @@ -0,0 +1,69 @@ + + + + + Debug + AnyCPU + {97F4550F-5775-4E40-8ECF-A03479884120} + Exe + ColorTool + colortool + v4.7 + 512 + true + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + True + True + Resources.resx + + + + + + + + + PublicResXFileCodeGenerator + Resources.Designer.cs + + + + \ No newline at end of file diff --git a/tools/ColorTool/ColorTool/ConsoleAPI.cs b/tools/ColorTool/ColorTool/ConsoleAPI.cs new file mode 100644 index 0000000000..4e438111f0 --- /dev/null +++ b/tools/ColorTool/ColorTool/ConsoleAPI.cs @@ -0,0 +1,68 @@ +// +// Copyright (C) Microsoft. All rights reserved. +// Licensed under the terms described in the LICENSE file in the root of this project. +// + +using System; +using System.Runtime.InteropServices; + +namespace ColorTool +{ + class ConsoleAPI + { + //////////////////////////////////////////////////////////////////////// + [StructLayout(LayoutKind.Sequential)] + public struct COORD + { + public short X; + public short Y; + } + + public struct SMALL_RECT + { + public short Left; + public short Top; + public short Right; + public short Bottom; + } + + [StructLayout(LayoutKind.Sequential)] + public struct CONSOLE_SCREEN_BUFFER_INFO_EX + { + public uint cbSize; + public COORD dwSize; + public COORD dwCursorPosition; + public short wAttributes; + public SMALL_RECT srWindow; + public COORD dwMaximumWindowSize; + + public ushort wPopupAttributes; + public bool bFullscreenSupported; + + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] + public uint[] ColorTable; + + public static CONSOLE_SCREEN_BUFFER_INFO_EX Create() + { + return new CONSOLE_SCREEN_BUFFER_INFO_EX { cbSize = 96 }; + } + } + + [DllImport("kernel32.dll", SetLastError = true)] + public static extern IntPtr GetStdHandle(int nStdHandle); + + [DllImport("kernel32.dll", SetLastError = true)] + public static extern bool GetConsoleScreenBufferInfoEx(IntPtr hConsoleOutput, ref CONSOLE_SCREEN_BUFFER_INFO_EX ConsoleScreenBufferInfo); + + [DllImport("kernel32.dll", SetLastError = true)] + public static extern bool SetConsoleScreenBufferInfoEx(IntPtr ConsoleOutput, ref CONSOLE_SCREEN_BUFFER_INFO_EX ConsoleScreenBufferInfoEx); + //////////////////////////////////////////////////////////////////////// + + public static uint RGB(int r, int g, int b) + { + return (uint)r + (((uint)g) << 8) + (((uint)b) << 16); + } + + public const int COLOR_TABLE_SIZE = 16; + } +} diff --git a/tools/ColorTool/ColorTool/ISchemeParser.cs b/tools/ColorTool/ColorTool/ISchemeParser.cs new file mode 100644 index 0000000000..df8cfcec2d --- /dev/null +++ b/tools/ColorTool/ColorTool/ISchemeParser.cs @@ -0,0 +1,12 @@ +// +// Copyright (C) Microsoft. All rights reserved. +// Licensed under the terms described in the LICENSE file in the root of this project. +// + +namespace ColorTool +{ + interface ISchemeParser + { + uint[] ParseScheme(string schemeName); + } +} diff --git a/tools/ColorTool/ColorTool/IniSchemeParser.cs b/tools/ColorTool/ColorTool/IniSchemeParser.cs new file mode 100644 index 0000000000..3b1789f57c --- /dev/null +++ b/tools/ColorTool/ColorTool/IniSchemeParser.cs @@ -0,0 +1,153 @@ +// +// Copyright (C) Microsoft. All rights reserved. +// Licensed under the terms described in the LICENSE file in the root of this project. +// + +using System; +using System.Text; +using System.Runtime.InteropServices; +using static ColorTool.ConsoleAPI; +using System.IO; + +namespace ColorTool +{ + class IniSchemeParser : ISchemeParser + { + [DllImport("kernel32")] + private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath); + + // These are in Windows Color table order - BRG, not RGB. + static string[] COLOR_NAMES = { + "DARK_BLACK", + "DARK_BLUE", + "DARK_GREEN", + "DARK_CYAN", + "DARK_RED", + "DARK_MAGENTA", + "DARK_YELLOW", + "DARK_WHITE", + "BRIGHT_BLACK", + "BRIGHT_BLUE", + "BRIGHT_GREEN", + "BRIGHT_CYAN", + "BRIGHT_RED", + "BRIGHT_MAGENTA", + "BRIGHT_YELLOW", + "BRIGHT_WHITE" + }; + + static uint ParseHex(string arg) + { + System.Drawing.Color col = System.Drawing.ColorTranslator.FromHtml(arg); + return RGB(col.R, col.G, col.B); + } + + static uint ParseRgb(string arg) + { + int[] components = { 0, 0, 0}; + string[] args = arg.Split(','); + if (args.Length != components.Length) throw new Exception("Invalid color format \"" + arg + "\""); + if (args.Length != 3) throw new Exception("Invalid color format \"" + arg + "\""); + for (int i = 0; i < args.Length; i++){ + components[i] = Int32.Parse(args[i]); + } + + return RGB(components[0], components[1], components[2]); + } + + static uint ParseColor(string arg) + { + if (arg[0] == '#') + { + return ParseHex(arg.Substring(1)); + } + else + { + return ParseRgb(arg); + } + } + + // TODO: Abstract the locating of a scheme into a function the implementation can call into + // Both parsers duplicate the searching, they should just pass in their extension and + // a callback for initally validating the file + static string FindIniScheme(string schemeName) + { + string exeDir = System.IO.Directory.GetParent(System.Reflection.Assembly.GetEntryAssembly().Location).FullName; + string filename = schemeName + ".ini"; + string exeSchemes = exeDir + "/schemes/"; + string cwd = "./"; + string cwdSchemes = "./schemes/"; + // Search order, for argument "name", where 'exe' is the dir of the exe. + // 1. ./name + // 2. ./name.ini + // 3. ./schemes/name + // 4. ./schemes/name.ini + // 5. exe/schemes/name + // 6. exe/schemes/name.ini + // 7. name (as an absolute path) + string[] paths = { + cwd + schemeName, + cwd + filename, + cwdSchemes + schemeName, + cwdSchemes + filename, + exeSchemes + schemeName, + exeSchemes + filename, + schemeName, + }; + foreach (string path in paths) + { + if (File.Exists(path)) + { + return path; + } + } + return null; + } + + public uint[] ParseScheme(string schemeName) + { + bool success = true; + + string filename = FindIniScheme(schemeName); + if (filename == null) return null; + + string[] tableStrings = new string[COLOR_TABLE_SIZE]; + uint[] colorTable = null; + + for (int i = 0; i < COLOR_TABLE_SIZE; i++) + { + string name = COLOR_NAMES[i]; + StringBuilder buffer = new StringBuilder(512); + GetPrivateProfileString("table", name, null, buffer, 512, filename); + + tableStrings[i] = buffer.ToString(); + if (tableStrings[i].Length <= 0) + { + success = false; + Console.WriteLine(string.Format(Resources.IniParseError, filename, name, tableStrings[i])); + break; + } + } + + if (success) + { + try + { + colorTable = new uint[COLOR_TABLE_SIZE]; + for (int i = 0; i < COLOR_TABLE_SIZE; i++) + { + colorTable[i] = ParseColor(tableStrings[i]); + } + } + catch (Exception /*e*/) + { + Console.WriteLine(string.Format(Resources.IniLoadError, filename)); + + colorTable = null; + } + } + + return colorTable; + } + } +} diff --git a/tools/ColorTool/ColorTool/Program.cs b/tools/ColorTool/ColorTool/Program.cs new file mode 100644 index 0000000000..1f56047f22 --- /dev/null +++ b/tools/ColorTool/ColorTool/Program.cs @@ -0,0 +1,282 @@ +// +// 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; +using Microsoft.Win32; +using System.Reflection; + +namespace ColorTool +{ + class Program + { + static int DARK_BLACK = 0; + static int DARK_BLUE = 1; + static int DARK_GREEN = 2; + static int DARK_CYAN = 3; + static int DARK_RED = 4; + static int DARK_MAGENTA = 5; + static int DARK_YELLOW = 6; + static int DARK_WHITE = 7; + static int BRIGHT_BLACK = 8; + static int BRIGHT_BLUE = 9; + static int BRIGHT_GREEN = 10; + static int BRIGHT_CYAN = 11; + static int BRIGHT_RED = 12; + static int BRIGHT_MAGENTA = 13; + static int BRIGHT_YELLOW = 14; + static int BRIGHT_WHITE = 15; + + static int[] saneFgs = { + DARK_BLACK , + DARK_RED , + DARK_GREEN , + DARK_YELLOW , + DARK_BLUE , + DARK_MAGENTA , + DARK_CYAN , + DARK_WHITE , + BRIGHT_BLACK , + BRIGHT_RED , + BRIGHT_GREEN , + BRIGHT_YELLOW , + BRIGHT_MAGENTA , + BRIGHT_BLUE , + BRIGHT_CYAN , + BRIGHT_WHITE + }; + + // This is the order of colors when output by the table. + static int[] outputFgs = { + BRIGHT_WHITE , + DARK_BLACK , + BRIGHT_BLACK , + DARK_RED , + BRIGHT_RED , + DARK_GREEN , + BRIGHT_GREEN , + DARK_YELLOW , + BRIGHT_YELLOW , + DARK_BLUE , + BRIGHT_BLUE , + DARK_MAGENTA , + BRIGHT_MAGENTA , + DARK_CYAN , + BRIGHT_CYAN , + DARK_WHITE , + BRIGHT_WHITE + }; + + static int[] saneBgs = { + DARK_BLACK , + DARK_RED , + DARK_GREEN , + DARK_YELLOW , + DARK_BLUE , + DARK_MAGENTA , + DARK_CYAN , + DARK_WHITE + }; + + static bool quiteMode = false; + static bool setDefaults = false; + static bool setProperties = true; + + static void Usage() + { + Console.WriteLine(Resources.Usage); + } + + static void Version() + { + //System.Reflection.Assembly.GetEntryAssembly(); + //AssemblyName.GetAssemblyName(@"c:\path\to\file.dll").Version; + string exePath = System.Reflection.Assembly.GetEntryAssembly().Location; + Version ver = AssemblyName.GetAssemblyName(exePath).Version; + Console.WriteLine("colortool v" + ver); + } + + static void PrintTable() + { + ConsoleColor[] colors = (ConsoleColor[])ConsoleColor.GetValues(typeof(ConsoleColor)); + // Save the current background and foreground colors. + ConsoleColor currentBackground = Console.BackgroundColor; + ConsoleColor currentForeground = Console.ForegroundColor; + string test = " gYw "; + string[] FGs = { + "m", + "1m", + "30m", + "1;30m", + "31m", + "1;31m", + "32m", + "1;32m", + "33m", + "1;33m", + "34m", + "1;34m", + "35m", + "1;35m", + "36m", + "1;36m", + "37m", + "1;37m" + }; + string[] BGs = { + "m", + "40m", + "41m", + "42m", + "43m", + "44m", + "45m", + "46m", + "47m" + }; + + Console.Write("\t"); + for (int bg = 0; bg < BGs.Length; bg++) + { + if (bg > 0) Console.Write(" "); + Console.Write(" "); + Console.Write(bg == 0 ? " " : BGs[bg]); + Console.Write(" "); + } + Console.WriteLine(); + + for (int fg = 0; fg < FGs.Length; fg++) + { + Console.ForegroundColor = currentForeground; + Console.BackgroundColor = currentBackground; + + if (fg >= 0) Console.Write(FGs[fg] + "\t"); + + if (fg == 0) Console.ForegroundColor = currentForeground; + else Console.ForegroundColor = colors[outputFgs[fg - 1]]; + + for (int bg = 0; bg < BGs.Length; bg++) + { + if (bg > 0) Console.Write(" "); + if (bg == 0) + Console.BackgroundColor = currentBackground; + else Console.BackgroundColor = colors[saneBgs[bg - 1]]; + Console.Write(test); + Console.BackgroundColor = currentBackground; + } + Console.Write("\n"); + + } + Console.Write("\n"); + } + + static bool SetProperties(uint[] colorTable) + { + CONSOLE_SCREEN_BUFFER_INFO_EX csbiex = CONSOLE_SCREEN_BUFFER_INFO_EX.Create(); + int STD_OUTPUT_HANDLE = -11; + IntPtr hOut = GetStdHandle(STD_OUTPUT_HANDLE); + bool success = GetConsoleScreenBufferInfoEx(hOut, ref csbiex); + if (success) + { + csbiex.srWindow.Bottom++; + for (int i = 0; i < 16; i++) + { + csbiex.ColorTable[i] = colorTable[i]; + } + SetConsoleScreenBufferInfoEx(hOut, ref csbiex); + } + if (success) + { + if (!quiteMode) + { + PrintTable(); + } + } + return success; + } + static bool SetDefaults(uint[] colorTable) + { + RegistryKey consoleKey = Registry.CurrentUser.OpenSubKey("Console", true); + for (int i = 0; i < colorTable.Length; i++) + { + string valueName = "ColorTable" + (i < 10 ? "0" : "") + i; + consoleKey.SetValue(valueName, colorTable[i], RegistryValueKind.DWord); + } + Console.WriteLine(Resources.WroteToDefaults); + return true; + } + + + static void Main(string[] args) + { + if (args.Length < 1) + { + Usage(); + return; + } + + foreach (string arg in args) + { + switch (arg) + { + case "-q": + case "--quiet": + quiteMode = true; + break; + case "-d": + case "--defaults": + setDefaults = true; + setProperties = false; + break; + case "-b": + case "--both": + setDefaults = true; + setProperties = true; + break; + case "-?": + case "--help": + Usage(); + return; + case "-v": + case "--version": + Version(); + return; + default: + break; + } + } + + string schemeName = args[args.Length - 1]; + + uint[] colorTable = null; + ISchemeParser[] parsers = { new XmlSchemeParser(), new IniSchemeParser() }; + foreach (var parser in parsers) + { + uint[] table = parser.ParseScheme(schemeName); + if (table != null) + { + colorTable = table; + break; + } + } + + if (colorTable == null) + { + Console.WriteLine(string.Format(Resources.SchemeNotFound, schemeName)); + return; + } + + if (setDefaults) + { + SetDefaults(colorTable); + } + if (setProperties) + { + SetProperties(colorTable); + } + } + + } +} diff --git a/tools/ColorTool/ColorTool/Properties/AssemblyInfo.cs b/tools/ColorTool/ColorTool/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..d0698c57f4 --- /dev/null +++ b/tools/ColorTool/ColorTool/Properties/AssemblyInfo.cs @@ -0,0 +1,34 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("ColorTool")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ColorTool")] +[assembly: AssemblyCopyright("Copyright © 2017")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("97f4550f-5775-4e40-8ecf-a03479884120")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.*")] diff --git a/tools/ColorTool/ColorTool/Resources.Designer.cs b/tools/ColorTool/ColorTool/Resources.Designer.cs new file mode 100644 index 0000000000..e053d6d114 --- /dev/null +++ b/tools/ColorTool/ColorTool/Resources.Designer.cs @@ -0,0 +1,134 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace ColorTool { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ColorTool.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Error loading ini file "{0}". + /// + public static string IniLoadError { + get { + return ResourceManager.GetString("IniLoadError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Error loading ini file "{0}" + /// for key "{1}" + /// the value "{2}" is invalid. + /// + public static string IniParseError { + get { + return ResourceManager.GetString("IniParseError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid Color. + /// + public static string InvalidColor { + get { + return ResourceManager.GetString("InvalidColor", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid scheme - did not find 16 colors. + /// + public static string InvalidNumberOfColors { + get { + return ResourceManager.GetString("InvalidNumberOfColors", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not find or load "{0}". + /// + public static string SchemeNotFound { + get { + return ResourceManager.GetString("SchemeNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Usage: + /// colortool.exe [options] <schemename> + ///ColorTool is a utility for helping to set the color palette of the Windows Console. + ///By default, applies the colors in the specified .itermcolors or .ini file to the current console window. + ///This does NOT save the properties automatically. For that, you'll need to open the properties sheet and hit "Ok". + ///Included should be a `schemes/` directory with a selection of schemes of both formats for examples. + ///Feel free to add your own prefered scheme to that direc [rest of string was truncated]";. + /// + public static string Usage { + get { + return ResourceManager.GetString("Usage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Wrote selected scheme to the defaults.. + /// + public static string WroteToDefaults { + get { + return ResourceManager.GetString("WroteToDefaults", resourceCulture); + } + } + } +} diff --git a/tools/ColorTool/ColorTool/Resources.resx b/tools/ColorTool/ColorTool/Resources.resx new file mode 100644 index 0000000000..e999e0daab --- /dev/null +++ b/tools/ColorTool/ColorTool/Resources.resx @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Error loading ini file "{0}" + + + Error loading ini file "{0}" + for key "{1}" + the value "{2}" is invalid + + + Invalid Color + + + Invalid scheme - did not find 16 colors + + + Could not find or load "{0}" + + + Usage: + colortool.exe [options] <schemename> +ColorTool is a utility for helping to set the color palette of the Windows Console. +By default, applies the colors in the specified .itermcolors or .ini file to the current console window. +This does NOT save the properties automatically. For that, you'll need to open the properties sheet and hit "Ok". +Included should be a `schemes/` directory with a selection of schemes of both formats for examples. +Feel free to add your own prefered scheme to that directory. +Arguments: + <schemename>: The name of a color scheme. ct will try to first load it as an .itermcolors color scheme. + If that fails, it will look for it as an .ini file color scheme. +Options: + -?, --help : Display this help message + -q, --quiet : Don't print the color table after applying + -d, --defaults : Apply the scheme to only the defaults in the registry + -b, --both : Apply the scheme to both the current console and the defaults. + -v, --version : Display the version number + + + + Wrote selected scheme to the defaults. + + \ No newline at end of file diff --git a/tools/ColorTool/ColorTool/XmlSchemeParser.cs b/tools/ColorTool/ColorTool/XmlSchemeParser.cs new file mode 100644 index 0000000000..7afea4d8d0 --- /dev/null +++ b/tools/ColorTool/ColorTool/XmlSchemeParser.cs @@ -0,0 +1,178 @@ +// +// Copyright (C) Microsoft. All rights reserved. +// Licensed under the terms described in the LICENSE file in the root of this project. +// +using System; +using System.Xml; +using static ColorTool.ConsoleAPI; + +namespace ColorTool +{ + class XmlSchemeParser : ISchemeParser + { + // In Windows Color Table order + static string[] PLIST_COLOR_NAMES = { + "Ansi 0 Color", // DARK_BLACK + "Ansi 4 Color", // DARK_BLUE + "Ansi 2 Color", // DARK_GREEN + "Ansi 6 Color", // DARK_CYAN + "Ansi 1 Color", // DARK_RED + "Ansi 5 Color", // DARK_MAGENTA + "Ansi 3 Color", // DARK_YELLOW + "Ansi 7 Color", // DARK_WHITE + "Ansi 8 Color", // BRIGHT_BLACK + "Ansi 12 Color", // BRIGHT_BLUE + "Ansi 10 Color", // BRIGHT_GREEN + "Ansi 14 Color", // BRIGHT_CYAN + "Ansi 9 Color", // BRIGHT_RED + "Ansi 13 Color", // BRIGHT_MAGENTA + "Ansi 11 Color", // BRIGHT_YELLOW + "Ansi 15 Color" // BRIGHT_WHITE + }; + static string RED_KEY = "Red Component"; + static string GREEN_KEY = "Green Component"; + static string BLUE_KEY = "Blue Component"; + + static bool parseRgbFromXml(XmlNode components, ref uint rgb) + { + int r = -1; + int g = -1; + int b = -1; + + foreach (XmlNode c in components.ChildNodes) + { + if (c.Name == "key") + { + if (c.InnerText == RED_KEY) + { + r = (int)(255 * Convert.ToDouble(c.NextSibling.InnerText)); + } + else if (c.InnerText == GREEN_KEY) + { + g = (int)(255 * Convert.ToDouble(c.NextSibling.InnerText)); + } + else if (c.InnerText == BLUE_KEY) + { + b = (int)(255 * Convert.ToDouble(c.NextSibling.InnerText)); + } + else + { + continue; + } + } + } + if (r < 0 || g < 0 || b < 0) + { + Console.WriteLine(Resources.InvalidColor); + return false; + } + rgb = RGB(r, g, b); + return true; + } + + + static XmlDocument loadXmlScheme(string schemeName) + { + XmlDocument xmlDoc = new XmlDocument(); // Create an XML document object + string exeDir = System.IO.Directory.GetParent(System.Reflection.Assembly.GetEntryAssembly().Location).FullName; + bool found = false; + string filename = schemeName + ".itermcolors"; + string exeSchemes = exeDir + "/schemes/"; + string cwd = "./"; + string cwdSchemes = "./schemes/"; + // Search order, for argument "name", where 'exe' is the dir of the exe. + // 1. ./name + // 2. ./name.itermcolors + // 3. ./schemes/name + // 4. ./schemes/name.itermcolors + // 5. exe/schemes/name + // 6. exe/schemes/name.itermcolors + // 7. name (as an absolute path) + string[] paths = { + cwd + schemeName, + cwd + filename, + cwdSchemes + schemeName, + cwdSchemes + filename, + exeSchemes + schemeName, + exeSchemes + filename, + schemeName, + }; + foreach (string path in paths) + { + try + { + xmlDoc.Load(path); + found = true; + break; + } + catch (Exception /*e*/) + { + // We can either fail to find the file, + // or fail to parse the XML here. + } + } + + if (!found) + { + return null; + } + return xmlDoc; + } + + + public uint[] ParseScheme(string schemeName) + { + XmlDocument xmlDoc = loadXmlScheme(schemeName); // Create an XML document object + if (xmlDoc == null) return null; + XmlNode root = xmlDoc.GetElementsByTagName("dict")[0]; + XmlNodeList children = root.ChildNodes; + + uint[] colorTable = new uint[COLOR_TABLE_SIZE]; + int colorsFound = 0; + bool success = false; + foreach (XmlNode tableEntry in children) + { + if (tableEntry.Name == "key") + { + int index = -1; + for (int i = 0; i < COLOR_TABLE_SIZE; i++) + { + if (PLIST_COLOR_NAMES[i] == tableEntry.InnerText) + { + index = i; + break; + } + } + if (index == -1) + { + continue; + } + uint rgb = 0; ; + XmlNode components = tableEntry.NextSibling; + success = parseRgbFromXml(components, ref rgb); + if (!success) + { + break; + } + else + { + colorTable[index] = rgb; + colorsFound++; + } + } + + } + if (colorsFound < COLOR_TABLE_SIZE) + { + Console.WriteLine(Resources.InvalidNumberOfColors); + success = false; + } + if (!success) + { + return null; + } + return colorTable; + + } + } +} diff --git a/tools/ColorTool/LICENSE b/tools/ColorTool/LICENSE new file mode 100644 index 0000000000..21071075c2 --- /dev/null +++ b/tools/ColorTool/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/tools/ColorTool/README.md b/tools/ColorTool/README.md new file mode 100644 index 0000000000..c381a57961 --- /dev/null +++ b/tools/ColorTool/README.md @@ -0,0 +1,44 @@ +# ColorTool - colortool.exe + +``` +Usage: + colortool.exe [options] ; +ColorTool is a utility for helping to set the color palette of the Windows Console. +By default, applies the colors in the specified .itermcolors or .ini file to the current console window. +This does NOT save the properties automatically. For that, you'll need to open the properties sheet and hit "Ok". +Included should be a `schemes/` directory with a selection of schemes of both formats for examples. +Feel free to add your own prefered scheme to that directory. +Arguments: + : The name of a color scheme. ct will try to first load it as an .itermcolors color scheme. + If that fails, it will look for it as an .ini file color scheme. +Options: + -?, --help : Display this help message + -q, --quiet : Don't print the color table after applying + -d, --defaults : Apply the scheme to only the defaults in the registry + -b, --both : Apply the scheme to both the current console and the defaults. + -v, --version : Display the version number +``` + +## Included Schemes + + Included are two important color schemes in .ini file format - `cmd-legacy` and `campbell`. + + * `cmd-legacy` is the legacy color scheme of the Windows Console, before July 2017 + + * `campbell` is the new default scheme used by the Windows Console Host, as of the Fall Creator's Update. + + There are a few other schemes in that directory in both .ini format and .itermcolors. + +## Adding Schemes + + You can also add color schemes to the colortool easily. Take any existing scheme in `.itemcolors` format, and paste it in the `schemes/` directory. + + I recommend the excellent [iTerm2-Color-Schemes](https://github.com/mbadolato/iTerm2-Color-Schemes) repo, which has TONS of schemes to chose from, and previews. + +## Building + + Either build with Visual Studio, or use the included `build.bat` from the commandline to try and auto-detect your msbuild version. + +## Contributing + + This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. diff --git a/tools/ColorTool/ThirdPartyNotices.md b/tools/ColorTool/ThirdPartyNotices.md new file mode 100644 index 0000000000..8c02c37428 --- /dev/null +++ b/tools/ColorTool/ThirdPartyNotices.md @@ -0,0 +1,51 @@ +Third Party Notices +=================== +This software is based on or incorporates material from the projects listed below (collectively, “Third-Party Code”). Please Note: Microsoft is not the original author of the Third-Party Code. The original copyright notice and license text under which Microsoft received the Third-Party Code are set forth below. Such licenses and notices are provided solely for your information. Unless otherwise noted below, Microsoft, not the third party, licenses this Third-Party Code to you under the terms by which you received the Microsoft software or the service. Microsoft reserves all other rights not expressly granted, whether by implication, estoppel or otherwise. + +Do Not Translate or Localize + + +One Half Dark and One Half Light Schemes +---------------------------------------- + +Copyright (c) 2016 Son A. Pham + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +Solarized Dark and Light Schemes +-------------------------------- +Copyright (c) 2011 Ethan Schoonover + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/tools/ColorTool/all.bat b/tools/ColorTool/all.bat new file mode 100644 index 0000000000..8602076c42 --- /dev/null +++ b/tools/ColorTool/all.bat @@ -0,0 +1,14 @@ +@echo off + +rem all.bat +rem This tool can be used to iterate over all the schemes you have installed +rem To help find one that you like. Simply press Ctrl+C when you get to one you like. +rem Note: You will likely destroy your current console window's history. +rem Only the most recent theme is visible in the console. +rem All of the previously viewed tables will display the current scheme's colors. + +for %%i in (schemes\*) do ( + echo %%i + ct.exe "%%i" + pause +) \ No newline at end of file diff --git a/tools/ColorTool/build.bat b/tools/ColorTool/build.bat new file mode 100644 index 0000000000..e39dc3d8e4 --- /dev/null +++ b/tools/ColorTool/build.bat @@ -0,0 +1,63 @@ +@echo off + +rem Add path to MSBuild Binaries +set MSBUILD=() +if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild.exe" ( + set MSBUILD="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild.exe" + goto :FOUND_MSBUILD +) +if exist "%ProgramFiles%\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild.exe" ( + set MSBUILD="%ProgramFiles%\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild.exe" + goto :FOUND_MSBUILD +) +if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\msbuild.exe" ( + set MSBUILD="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\msbuild.exe" + goto :FOUND_MSBUILD +) +if exist "%ProgramFiles%\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\msbuild.exe" ( + set MSBUILD="%ProgramFiles%\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\msbuild.exe" + goto :FOUND_MSBUILD +) +if exist "%ProgramFiles(x86)%\MSBuild\14.0\bin" ( + set MSBUILD="%ProgramFiles(x86)%\MSBuild\14.0\bin\msbuild.exe" + goto :FOUND_MSBUILD +) +if exist "%ProgramFiles%\MSBuild\14.0\bin" ( + set MSBUILD="%ProgramFiles%\MSBuild\14.0\bin\msbuild.exe" + goto :FOUND_MSBUILD +) + +if %MSBUILD%==() ( + echo "I couldn't find MSBuild on your PC. Make sure it's installed somewhere, and if it's not in the above if statements (in build.bat), add it." + goto :EXIT +) +:FOUND_MSBUILD +set _MSBUILD_TARGET=Build +set _MSBUILD_CONFIG=Debug + +:ARGS_LOOP +if (%1) == () goto :POST_ARGS_LOOP +if (%1) == (clean) ( + set _MSBUILD_TARGET=Clean,Build +) +if (%1) == (rel) ( + set _MSBUILD_CONFIG=Release +) +shift +goto :ARGS_LOOP + +:POST_ARGS_LOOP +%MSBUILD% %~dp0ColorTool.sln /t:%_MSBUILD_TARGET% /m /nr:true /p:Configuration=%_MSBUILD_CONFIG% + +if (%ERRORLEVEL%) == (0) ( + echo. + echo Created exe in: + echo %~dp0ColorTool\bin\%_MSBUILD_CONFIG%\colortool.exe + echo. + echo Copying exe to root of project... + copy %~dp0ColorTool\bin\%_MSBUILD_CONFIG%\colortool.exe %~dp0colortool.exe + echo Done. + echo. +) + +:EXIT \ No newline at end of file diff --git a/tools/ColorTool/schemes/OneHalfDark.itermcolors b/tools/ColorTool/schemes/OneHalfDark.itermcolors new file mode 100644 index 0000000000..50987c8fab --- /dev/null +++ b/tools/ColorTool/schemes/OneHalfDark.itermcolors @@ -0,0 +1,376 @@ + + + + + + Ansi 0 Color + + Alpha Component + 1 + Blue Component + 0.203921568627 + Color Space + Calibrated + Green Component + 0.172549019608 + Red Component + 0.156862745098 + + Ansi 1 Color + + Alpha Component + 1 + Blue Component + 0.458823529412 + Color Space + Calibrated + Green Component + 0.423529411765 + Red Component + 0.878431372549 + + Ansi 10 Color + + Alpha Component + 1 + Blue Component + 0.474509803922 + Color Space + Calibrated + Green Component + 0.764705882353 + Red Component + 0.596078431373 + + Ansi 11 Color + + Alpha Component + 1 + Blue Component + 0.482352941176 + Color Space + Calibrated + Green Component + 0.752941176471 + Red Component + 0.898039215686 + + Ansi 12 Color + + Alpha Component + 1 + Blue Component + 0.937254901961 + Color Space + Calibrated + Green Component + 0.686274509804 + Red Component + 0.380392156863 + + Ansi 13 Color + + Alpha Component + 1 + Blue Component + 0.866666666667 + Color Space + Calibrated + Green Component + 0.470588235294 + Red Component + 0.776470588235 + + Ansi 14 Color + + Alpha Component + 1 + Blue Component + 0.760784313725 + Color Space + Calibrated + Green Component + 0.713725490196 + Red Component + 0.337254901961 + + Ansi 15 Color + + Alpha Component + 1 + Blue Component + 0.894117647059 + Color Space + Calibrated + Green Component + 0.874509803922 + Red Component + 0.862745098039 + + Ansi 2 Color + + Alpha Component + 1 + Blue Component + 0.474509803922 + Color Space + Calibrated + Green Component + 0.764705882353 + Red Component + 0.596078431373 + + Ansi 3 Color + + Alpha Component + 1 + Blue Component + 0.482352941176 + Color Space + Calibrated + Green Component + 0.752941176471 + Red Component + 0.898039215686 + + Ansi 4 Color + + Alpha Component + 1 + Blue Component + 0.937254901961 + Color Space + Calibrated + Green Component + 0.686274509804 + Red Component + 0.380392156863 + + Ansi 5 Color + + Alpha Component + 1 + Blue Component + 0.866666666667 + Color Space + Calibrated + Green Component + 0.470588235294 + Red Component + 0.776470588235 + + Ansi 6 Color + + Alpha Component + 1 + Blue Component + 0.760784313725 + Color Space + Calibrated + Green Component + 0.713725490196 + Red Component + 0.337254901961 + + Ansi 7 Color + + Alpha Component + 1 + Blue Component + 0.894117647059 + Color Space + Calibrated + Green Component + 0.874509803922 + Red Component + 0.862745098039 + + Ansi 8 Color + + Alpha Component + 1 + Blue Component + 0.203921568627 + Color Space + Calibrated + Green Component + 0.172549019608 + Red Component + 0.156862745098 + + Ansi 9 Color + + Alpha Component + 1 + Blue Component + 0.458823529412 + Color Space + Calibrated + Green Component + 0.423529411765 + Red Component + 0.878431372549 + + Background Color + + Alpha Component + 1 + Blue Component + 0.203921568627 + Color Space + Calibrated + Green Component + 0.172549019608 + Red Component + 0.156862745098 + + Badge Color + + Alpha Component + 0.5 + Blue Component + 0.0 + Color Space + Calibrated + Green Component + 0.0 + Red Component + 1 + + Bold Color + + Alpha Component + 1 + Blue Component + 0.74901962280273438 + Color Space + Calibrated + Green Component + 0.69803923368453979 + Red Component + 0.67058825492858887 + + Cursor Color + + Alpha Component + 1 + Blue Component + 0.8 + Color Space + Calibrated + Green Component + 0.701960784314 + Red Component + 0.639215686275 + + Cursor Guide Color + + Alpha Component + 0.25 + Blue Component + 0.250980392157 + Color Space + Calibrated + Green Component + 0.211764705882 + Red Component + 0.192156862745 + + Cursor Text Color + + Alpha Component + 1 + Blue Component + 0.894117647059 + Color Space + Calibrated + Green Component + 0.874509803922 + Red Component + 0.862745098039 + + Foreground Color + + Alpha Component + 1 + Blue Component + 0.894117647059 + Color Space + Calibrated + Green Component + 0.874509803922 + Red Component + 0.862745098039 + + Link Color + + Alpha Component + 1 + Blue Component + 0.937254901961 + Color Space + Calibrated + Green Component + 0.686274509804 + Red Component + 0.380392156863 + + Selected Text Color + + Alpha Component + 1 + Blue Component + 0.894117647059 + Color Space + Calibrated + Green Component + 0.874509803922 + Red Component + 0.862745098039 + + Selection Color + + Alpha Component + 1 + Blue Component + 0.364705882353 + Color Space + Calibrated + Green Component + 0.305882352941 + Red Component + 0.278431372549 + + + \ No newline at end of file diff --git a/tools/ColorTool/schemes/OneHalfLight.itermcolors b/tools/ColorTool/schemes/OneHalfLight.itermcolors new file mode 100644 index 0000000000..5039196027 --- /dev/null +++ b/tools/ColorTool/schemes/OneHalfLight.itermcolors @@ -0,0 +1,376 @@ + + + + + + Ansi 0 Color + + Alpha Component + 1 + Blue Component + 0.258823529412 + Color Space + Calibrated + Green Component + 0.227450980392 + Red Component + 0.219607843137 + + Ansi 1 Color + + Alpha Component + 1 + Blue Component + 0.286274509804 + Color Space + Calibrated + Green Component + 0.337254901961 + Red Component + 0.894117647059 + + Ansi 10 Color + + Alpha Component + 1 + Blue Component + 0.474509803922 + Color Space + Calibrated + Green Component + 0.764705882353 + Red Component + 0.596078431373 + + Ansi 11 Color + + Alpha Component + 1 + Blue Component + 0.482352941176 + Color Space + Calibrated + Green Component + 0.752941176471 + Red Component + 0.898039215686 + + Ansi 12 Color + + Alpha Component + 1 + Blue Component + 0.937254901961 + Color Space + Calibrated + Green Component + 0.686274509804 + Red Component + 0.380392156863 + + Ansi 13 Color + + Alpha Component + 1 + Blue Component + 0.866666666667 + Color Space + Calibrated + Green Component + 0.470588235294 + Red Component + 0.776470588235 + + Ansi 14 Color + + Alpha Component + 1 + Blue Component + 0.760784313725 + Color Space + Calibrated + Green Component + 0.713725490196 + Red Component + 0.337254901961 + + Ansi 15 Color + + Alpha Component + 1 + Blue Component + 1.0 + Color Space + Calibrated + Green Component + 1.0 + Red Component + 1.0 + + Ansi 2 Color + + Alpha Component + 1 + Blue Component + 0.309803921569 + Color Space + Calibrated + Green Component + 0.63137254902 + Red Component + 0.313725490196 + + Ansi 3 Color + + Alpha Component + 1 + Blue Component + 0.00392156862745 + Color Space + Calibrated + Green Component + 0.517647058824 + Red Component + 0.756862745098 + + Ansi 4 Color + + Alpha Component + 1 + Blue Component + 0.737254901961 + Color Space + Calibrated + Green Component + 0.517647058824 + Red Component + 0.00392156862745 + + Ansi 5 Color + + Alpha Component + 1 + Blue Component + 0.643137254902 + Color Space + Calibrated + Green Component + 0.149019607843 + Red Component + 0.650980392157 + + Ansi 6 Color + + Alpha Component + 1 + Blue Component + 0.701960784314 + Color Space + Calibrated + Green Component + 0.592156862745 + Red Component + 0.0352941176471 + + Ansi 7 Color + + Alpha Component + 1 + Blue Component + 0.980392156863 + Color Space + Calibrated + Green Component + 0.980392156863 + Red Component + 0.980392156863 + + Ansi 8 Color + + Alpha Component + 1 + Blue Component + 0.36862745098 + Color Space + Calibrated + Green Component + 0.321568627451 + Red Component + 0.309803921569 + + Ansi 9 Color + + Alpha Component + 1 + Blue Component + 0.458823529412 + Color Space + Calibrated + Green Component + 0.423529411765 + Red Component + 0.878431372549 + + Background Color + + Alpha Component + 1 + Blue Component + 0.980392156863 + Color Space + Calibrated + Green Component + 0.980392156863 + Red Component + 0.980392156863 + + Badge Color + + Alpha Component + 0.5 + Blue Component + 0.0 + Color Space + Calibrated + Green Component + 0.0 + Red Component + 1 + + Bold Color + + Alpha Component + 1 + Blue Component + 0.74901962280273438 + Color Space + Calibrated + Green Component + 0.69803923368453979 + Red Component + 0.67058825492858887 + + Cursor Color + + Alpha Component + 1 + Blue Component + 1.0 + Color Space + Calibrated + Green Component + 0.807843137255 + Red Component + 0.749019607843 + + Cursor Guide Color + + Alpha Component + 0.25 + Blue Component + 0.941176470588 + Color Space + Calibrated + Green Component + 0.941176470588 + Red Component + 0.941176470588 + + Cursor Text Color + + Alpha Component + 1 + Blue Component + 0.258823529412 + Color Space + Calibrated + Green Component + 0.227450980392 + Red Component + 0.219607843137 + + Foreground Color + + Alpha Component + 1 + Blue Component + 0.258823529412 + Color Space + Calibrated + Green Component + 0.227450980392 + Red Component + 0.219607843137 + + Link Color + + Alpha Component + 1 + Blue Component + 0.737254901961 + Color Space + Calibrated + Green Component + 0.517647058824 + Red Component + 0.00392156862745 + + Selected Text Color + + Alpha Component + 1 + Blue Component + 0.258823529412 + Color Space + Calibrated + Green Component + 0.227450980392 + Red Component + 0.219607843137 + + Selection Color + + Alpha Component + 1 + Blue Component + 1.0 + Color Space + Calibrated + Green Component + 0.807843137255 + Red Component + 0.749019607843 + + + \ No newline at end of file diff --git a/tools/ColorTool/schemes/campbell-legacy.ini b/tools/ColorTool/schemes/campbell-legacy.ini new file mode 100644 index 0000000000..0374bbb4e9 --- /dev/null +++ b/tools/ColorTool/schemes/campbell-legacy.ini @@ -0,0 +1,21 @@ +[table] +DARK_BLACK = 19,17,23 +DARK_BLUE = 6,54,222 +DARK_GREEN = 57,151,50 +DARK_CYAN = 48,151,168 +DARK_RED = 185,0,5 +DARK_MAGENTA = 141,2,180 +DARK_YELLOW = 187,182,0 +DARK_WHITE = 192,190,197 +BRIGHT_BLACK = 85,82,92 +BRIGHT_BLUE = 62,109,253 +BRIGHT_GREEN = 11,213,0 +BRIGHT_CYAN = 128,205,253 +BRIGHT_RED = 237,57,96 +BRIGHT_MAGENTA = 198,2,253 +BRIGHT_YELLOW = 255,247,149 +BRIGHT_WHITE = 240,239,241 + +[info] +name = Campbell-Legacy +author = paulcam \ No newline at end of file diff --git a/tools/ColorTool/schemes/campbell.ini b/tools/ColorTool/schemes/campbell.ini new file mode 100644 index 0000000000..6ce99f6f3b --- /dev/null +++ b/tools/ColorTool/schemes/campbell.ini @@ -0,0 +1,21 @@ +[table] +DARK_BLACK = 12,12,12 +DARK_BLUE = 0,55,218 +DARK_GREEN = 19,161,14 +DARK_CYAN = 58,150,221 +DARK_RED = 197,15,31 +DARK_MAGENTA = 136,23,152 +DARK_YELLOW = 193,156,0 +DARK_WHITE = 204,204,204 +BRIGHT_BLACK = 118,118,118 +BRIGHT_BLUE = 59,120,255 +BRIGHT_GREEN = 22,198,12 +BRIGHT_CYAN = 97,214,214 +BRIGHT_RED = 231,72,86 +BRIGHT_MAGENTA = 180,0,158 +BRIGHT_YELLOW = 249,241,165 +BRIGHT_WHITE = 242,242,242 + +[info] +name = Campbell +author = crloew \ No newline at end of file diff --git a/tools/ColorTool/schemes/cmd-legacy.ini b/tools/ColorTool/schemes/cmd-legacy.ini new file mode 100644 index 0000000000..39ee2f4de0 --- /dev/null +++ b/tools/ColorTool/schemes/cmd-legacy.ini @@ -0,0 +1,21 @@ +[table] +DARK_BLACK = 0, 0, 0 +DARK_BLUE = 0, 0, 128 +DARK_GREEN = 0, 128, 0 +DARK_CYAN = 0, 128, 128 +DARK_RED = 128, 0, 0 +DARK_MAGENTA = 128, 0, 128 +DARK_YELLOW = 128, 128, 0 +DARK_WHITE = 192, 192, 192 +BRIGHT_BLACK = 128, 128, 128 +BRIGHT_BLUE = 0, 0, 255 +BRIGHT_GREEN = 0, 255, 0 +BRIGHT_CYAN = 0, 255, 255 +BRIGHT_RED = 255, 0, 0 +BRIGHT_MAGENTA = 255, 0, 255 +BRIGHT_YELLOW = 255, 255, 0 +BRIGHT_WHITE = 255, 255, 255 + +[info] +name = cmd-legacy +author = unknown \ No newline at end of file diff --git a/tools/ColorTool/schemes/deuteranopia.itermcolors b/tools/ColorTool/schemes/deuteranopia.itermcolors new file mode 100644 index 0000000000..beb56369fb --- /dev/null +++ b/tools/ColorTool/schemes/deuteranopia.itermcolors @@ -0,0 +1,293 @@ + + + + + + Ansi 0 Color + + Color Space + sRGB + Blue Component + 0 + Green Component + 0 + Red Component + 0 + + Ansi 1 Color + + Color Space + sRGB + Blue Component + 0 + Green Component + 0.6 + Red Component + 0.6 + + Ansi 10 Color + + Color Space + sRGB + Blue Component + 1 + Green Component + 0 + Red Component + 0 + + Ansi 11 Color + + Color Space + sRGB + Blue Component + 0.7490196078431373 + Green Component + 1 + Red Component + 1 + + Ansi 12 Color + + Color Space + sRGB + Blue Component + 1 + Green Component + 0.5019607843137255 + Red Component + 0.5019607843137255 + + Ansi 13 Color + + Color Space + sRGB + Blue Component + 0.5019607843137255 + Green Component + 1 + Red Component + 1 + + Ansi 14 Color + + Color Space + sRGB + Blue Component + 1 + Green Component + 0.7490196078431373 + Red Component + 0.7490196078431373 + + Ansi 15 Color + + Color Space + sRGB + Blue Component + 1 + Green Component + 1 + Red Component + 1 + + Ansi 2 Color + + Color Space + sRGB + Blue Component + 0.6 + Green Component + 0 + Red Component + 0 + + Ansi 3 Color + + Color Space + sRGB + Blue Component + 0.45098039215686275 + Green Component + 0.6 + Red Component + 0.6 + + Ansi 4 Color + + Color Space + sRGB + Blue Component + 0.6 + Green Component + 0.30196078431372547 + Red Component + 0.30196078431372547 + + Ansi 5 Color + + Color Space + sRGB + Blue Component + 0.30196078431372547 + Green Component + 0.6 + Red Component + 0.6 + + Ansi 6 Color + + Color Space + sRGB + Blue Component + 0.6 + Green Component + 0.45098039215686275 + Red Component + 0.45098039215686275 + + Ansi 7 Color + + Color Space + sRGB + Blue Component + 0.7686274509803922 + Green Component + 0.7686274509803922 + Red Component + 0.7686274509803922 + + Ansi 8 Color + + Color Space + sRGB + Blue Component + 0.4235294117647059 + Green Component + 0.4235294117647059 + Red Component + 0.4235294117647059 + + Ansi 9 Color + + Color Space + sRGB + Blue Component + 0 + Green Component + 1 + Red Component + 1 + + Background Color + + Color Space + sRGB + Blue Component + 0 + Green Component + 0 + Red Component + 0 + + Bold Color + + Color Space + sRGB + Blue Component + 0.7686274509803922 + Green Component + 0.7686274509803922 + Red Component + 0.7686274509803922 + + Cursor Color + + Color Space + sRGB + Blue Component + 0.7686274509803922 + Green Component + 0.7686274509803922 + Red Component + 0.7686274509803922 + + Cursor Text Color + + Color Space + sRGB + Blue Component + 0 + Green Component + 0 + Red Component + 0 + + Foreground Color + + Color Space + sRGB + Blue Component + 0.7686274509803922 + Green Component + 0.7686274509803922 + Red Component + 0.7686274509803922 + + Selected Text Color + + Color Space + sRGB + Blue Component + 0.7686274509803922 + Green Component + 0.7686274509803922 + Red Component + 0.7686274509803922 + + Selection Color + + Color Space + sRGB + Blue Component + 0 + Green Component + 0 + Red Component + 0 + + + diff --git a/tools/ColorTool/schemes/solarized_dark.itermcolors b/tools/ColorTool/schemes/solarized_dark.itermcolors new file mode 100644 index 0000000000..4a727fb700 --- /dev/null +++ b/tools/ColorTool/schemes/solarized_dark.itermcolors @@ -0,0 +1,243 @@ + + + + + + Ansi 0 Color + + Blue Component + 0.19370138645172119 + Green Component + 0.15575926005840302 + Red Component + 0.0 + + Ansi 1 Color + + Blue Component + 0.14145714044570923 + Green Component + 0.10840655118227005 + Red Component + 0.81926977634429932 + + Ansi 10 Color + + Blue Component + 0.38298487663269043 + Green Component + 0.35665956139564514 + Red Component + 0.27671992778778076 + + Ansi 11 Color + + Blue Component + 0.43850564956665039 + Green Component + 0.40717673301696777 + Red Component + 0.32436618208885193 + + Ansi 12 Color + + Blue Component + 0.51685798168182373 + Green Component + 0.50962930917739868 + Red Component + 0.44058024883270264 + + Ansi 13 Color + + Blue Component + 0.72908437252044678 + Green Component + 0.33896297216415405 + Red Component + 0.34798634052276611 + + Ansi 14 Color + + Blue Component + 0.56363654136657715 + Green Component + 0.56485837697982788 + Red Component + 0.50599193572998047 + + Ansi 15 Color + + Blue Component + 0.86405980587005615 + Green Component + 0.95794391632080078 + Red Component + 0.98943418264389038 + + Ansi 2 Color + + Blue Component + 0.020208755508065224 + Green Component + 0.54115492105484009 + Red Component + 0.44977453351020813 + + Ansi 3 Color + + Blue Component + 0.023484811186790466 + Green Component + 0.46751424670219421 + Red Component + 0.64746475219726562 + + Ansi 4 Color + + Blue Component + 0.78231418132781982 + Green Component + 0.46265947818756104 + Red Component + 0.12754884362220764 + + Ansi 5 Color + + Blue Component + 0.43516635894775391 + Green Component + 0.10802463442087173 + Red Component + 0.77738940715789795 + + Ansi 6 Color + + Blue Component + 0.52502274513244629 + Green Component + 0.57082360982894897 + Red Component + 0.14679534733295441 + + Ansi 7 Color + + Blue Component + 0.79781103134155273 + Green Component + 0.89001238346099854 + Red Component + 0.91611063480377197 + + Ansi 8 Color + + Blue Component + 0.15170273184776306 + Green Component + 0.11783610284328461 + Red Component + 0.0 + + Ansi 9 Color + + Blue Component + 0.073530435562133789 + Green Component + 0.21325300633907318 + Red Component + 0.74176257848739624 + + Background Color + + Blue Component + 0.15170273184776306 + Green Component + 0.11783610284328461 + Red Component + 0.0 + + Bold Color + + Blue Component + 0.56363654136657715 + Green Component + 0.56485837697982788 + Red Component + 0.50599193572998047 + + Cursor Color + + Blue Component + 0.51685798168182373 + Green Component + 0.50962930917739868 + Red Component + 0.44058024883270264 + + Cursor Text Color + + Blue Component + 0.19370138645172119 + Green Component + 0.15575926005840302 + Red Component + 0.0 + + Foreground Color + + Blue Component + 0.51685798168182373 + Green Component + 0.50962930917739868 + Red Component + 0.44058024883270264 + + Selected Text Color + + Blue Component + 0.56363654136657715 + Green Component + 0.56485837697982788 + Red Component + 0.50599193572998047 + + Selection Color + + Blue Component + 0.19370138645172119 + Green Component + 0.15575926005840302 + Red Component + 0.0 + + + \ No newline at end of file diff --git a/tools/ColorTool/schemes/solarized_light.itermcolors b/tools/ColorTool/schemes/solarized_light.itermcolors new file mode 100644 index 0000000000..b39cc7714c --- /dev/null +++ b/tools/ColorTool/schemes/solarized_light.itermcolors @@ -0,0 +1,289 @@ + + + + + + Ansi 0 Color + + Color Space + sRGB + Blue Component + 0.8901960784313725 + Green Component + 0.9647058823529412 + Red Component + 0.9921568627450981 + + Ansi 1 Color + + Color Space + sRGB + Blue Component + 0.1843137254901961 + Green Component + 0.19607843137254902 + Red Component + 0.8627450980392157 + + Ansi 10 Color + + Color Space + sRGB + Blue Component + 0 + Green Component + 0.6 + Red Component + 0.5215686274509804 + + Ansi 11 Color + + Color Space + sRGB + Blue Component + 0 + Green Component + 0.5372549019607843 + Red Component + 0.7098039215686275 + + Ansi 12 Color + + Color Space + sRGB + Blue Component + 0.8235294117647058 + Green Component + 0.5450980392156862 + Red Component + 0.14901960784313725 + + Ansi 13 Color + + Color Space + sRGB + Blue Component + 0.7686274509803922 + Green Component + 0.44313725490196076 + Red Component + 0.4235294117647059 + + Ansi 14 Color + + Color Space + sRGB + Blue Component + 0.596078431372549 + Green Component + 0.6313725490196078 + Red Component + 0.16470588235294117 + + Ansi 15 Color + + Color Space + sRGB + Blue Component + 0.4588235294117647 + Green Component + 0.43137254901960786 + Red Component + 0.34509803921568627 + + Ansi 2 Color + + Color Space + sRGB + Blue Component + 0 + Green Component + 0.6 + Red Component + 0.5215686274509804 + + Ansi 3 Color + + Color Space + sRGB + Blue Component + 0 + Green Component + 0.5372549019607843 + Red Component + 0.7098039215686275 + + Ansi 4 Color + + Color Space + sRGB + Blue Component + 0.8235294117647058 + Green Component + 0.5450980392156862 + Red Component + 0.14901960784313725 + + Ansi 5 Color + + Color Space + sRGB + Blue Component + 0.7686274509803922 + Green Component + 0.44313725490196076 + Red Component + 0.4235294117647059 + + Ansi 6 Color + + Color Space + sRGB + Blue Component + 0.596078431372549 + Green Component + 0.6313725490196078 + Red Component + 0.16470588235294117 + + Ansi 7 Color + + Color Space + sRGB + Blue Component + 0.6313725490196078 + Green Component + 0.6313725490196078 + Red Component + 0.5764705882352941 + + Ansi 8 Color + + Color Space + sRGB + Blue Component + 0.5137254901960784 + Green Component + 0.4823529411764706 + Red Component + 0.396078431372549 + + Ansi 9 Color + + Color Space + sRGB + Blue Component + 0.1843137254901961 + Green Component + 0.19607843137254902 + Red Component + 0.8627450980392157 + + Background Color + + Color Space + sRGB + Blue Component + 0.8901960784313725 + Green Component + 0.9647058823529412 + Red Component + 0.9921568627450981 + + Bold Color + + Color Space + sRGB + Blue Component + 0.4588235294117647 + Green Component + 0.43137254901960786 + Red Component + 0.34509803921568627 + + Cursor Color + + Color Space + sRGB + Blue Component + 0.4588235294117647 + Green Component + 0.43137254901960786 + Red Component + 0.34509803921568627 + + Cursor Text Color + + Color Space + sRGB + Blue Component + 0.8901960784313725 + Green Component + 0.9647058823529412 + Red Component + 0.9921568627450981 + + Foreground Color + + Color Space + sRGB + Blue Component + 0.4588235294117647 + Green Component + 0.43137254901960786 + Red Component + 0.34509803921568627 + + Selected Text Color + + Color Space + sRGB + Blue Component + 0.4588235294117647 + Green Component + 0.43137254901960786 + Red Component + 0.34509803921568627 + + Selection Color + + Color Space + sRGB + Blue Component + 0.8901960784313725 + Green Component + 0.9647058823529412 + Red Component + 0.9921568627450981 + + +