1 using System;
 2 
 3 namespace System
 4 {
 5     public enum ConsoleColor : byte
 6     {
 7         black = 0udarkBlue = 1udarkGreen = 2udarkCyan = 3udarkRed = 4udarkYellow = 6ugray = 7u
 8         darkGray = 8ublue = 9ugreen = 10ucyan = 11ured = 12umagenta = 13uyellow = 14uwhite = 15u
 9         defaultColor = 0xFFu
10     }
11     
12     public nothrow ConsoleColor DefaultConsoleBackColor()
13     {
14         return ConsoleColor.black;
15     }
16 
17     public nothrow ConsoleColor DefaultConsoleTextColor()
18     {
19         return ConsoleColor.gray;
20     }
21 
22     public const uchar colorChar = cast<uchar>(0x100000u);
23     public const uchar resetColors = cast<uchar>(0x10FFFDu);
24     
25     public nothrow uchar ColorChar(ConsoleColor foreColorConsoleColor backColor)
26     {
27         return cast<uchar>(cast<uint>(colorChar) | cast<uint>(cast<ushort>(cast<byte>(foreColor)) | (cast<ushort>(cast<byte>(backColor)) << 8u)));
28     }
29     
30     public nothrow string SetColors(ConsoleColor foreColorConsoleColor backColor)
31     {
32         return ToUtf8(ustring(ColorChar(foreColorbackColor)));
33     }
34     
35     public nothrow string ResetColors()
36     {
37         return ToUtf8(ustring(resetColors));
38     }
39 }