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 ::  
Csharp :: how set function when props update in vue 
Csharp :: how to make a mouse down condition in C# 
:: c# compress string 
Csharp :: palindrome number c# 
Csharp :: unity find gameobject 
Csharp :: Get key by his value on Dict C# 
Csharp :: Unity Rigidbody how to set zero momentum 
Csharp :: c# type from string 
Csharp :: c# timestamp now 
Csharp :: c# list tuple 
Csharp :: c# ftp file download 
Csharp :: c# loop string array 
Csharp :: string reverse c# 
Csharp :: c# read file from directory 
Csharp :: difference two list c# 
Csharp :: redirect to another controller page in asp.net core 
Csharp :: c# remove character from string at index 
:: letter at index of string c# 
Csharp :: decimal c# 2 digits 
Csharp :: httpcontext.current.session null c# in class library 
Csharp :: c# Get type with namespace 
Csharp :: how to create a random vector2 in unity 
Csharp :: c# add to array 
Csharp :: Operator Overloading | C# 
Csharp :: calculate distance using latitude and longitude c# 
Csharp :: recursive reverse linked list 
Csharp :: c# datagridview rows clear not working 
:: convert xml string to file c# 
ADD CONTENT
Topic
Content
Source link
Name
1+7 =