c# console foreground color
Console.ForegroundColor = ConsoleColor.DarkGreen;
c# console foreground color
Console.ForegroundColor = ConsoleColor.DarkGreen;
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;
}
f# console color
module Console =
open System
let log =
let lockObj = obj()
fun color s ->
lock lockObj (fun _ ->
Console.ForegroundColor <- color
printfn "%s" s
Console.ResetColor())
let complete = log ConsoleColor.Magenta
let ok = log ConsoleColor.Green
let info = log ConsoleColor.Cyan
let warn = log ConsoleColor.Yellow
let error = log ConsoleColor.Red
module Main =
let demo() =
let fileName = "myfile.txt"
Console.info <| sprintf "Opening file %s" fileName
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us