Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# console background color

Console.BackgroundColor = ConsoleColor.Green;
Comment

c# console foreground color

Console.ForegroundColor = ConsoleColor.DarkGreen;
Comment

c# console foreground color

//Background color
Console.BackgroundColor = ConsoleColor.Green;
//Foreground color
Console.ForegroundColor = ConsoleColor.Black;
//Reset
Console.ResetColor();
Comment

c# color to console color

 public static ConsoleColor FromColor(Color c)
        {
            int index = (c.R > 128 | c.G > 128 | c.B > 128) ? 8 : 0; // Bright bit
            index |= (c.R > 64) ? 4 : 0; // Red bit
            index |= (c.G > 64) ? 2 : 0; // Green bit
            index |= (c.B > 64) ? 1 : 0; // Blue bit

            return (System.ConsoleColor)index;
        }
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# string array to string 
Csharp :: unity movement 
Csharp :: how set function when props update in vue 
Csharp :: how to make a mouse down condition in C# 
Csharp :: c# compress string 
Csharp :: how to make a custom cursor in windows forms c# 
Csharp :: c# do while loop 
Csharp :: keybyvalue c# 
Csharp :: bytes to httppostedfilebase c# 
Csharp :: c# stop process 
Csharp :: unity get child gameobject 
Csharp :: csharp sleep code 1 second 
Csharp :: c# environment variables 
Csharp :: access to element in object c# 
Csharp :: C# decimal with two places store as string with two places 
Csharp :: remove index from array c# 
Csharp :: c# String.Concat() 
Csharp :: if number negative c sharp 
Csharp :: selection sort in c# 
Csharp :: list to list<selectlistitem c# 
Csharp :: unity overlapsphere 
Csharp :: unity get perlin noise 3d 
Csharp :: c# datagridview hide row selector 
Csharp :: difference between alpha and beta testing 
Csharp :: how to use navmeshagent in unity 
Csharp :: route attribute controller with parameter asp.net core 
Csharp :: streamwriter c# 
Csharp :: fluent assertion exception 
Csharp :: c# console password 
Csharp :: how to pass optional guid parameters in c# 
ADD CONTENT
Topic
Content
Source link
Name
1+4 =