Skip to content

vbfox/ColoredPrintf

Repository files navigation

Colored Printf

color drops Logo

Github Actions Status Nuget Package

This library provide a replacement to F# printf function with color support.

The syntax to set the color inside the string is $foreground;background[text] where both foreground and background are optional.

Examples

colorprintfn "Hello $red[world]."
colorprintfn "Hello $green[%s]." "user"
colorprintfn "$white[Progress]: $yellow[%.2f%%] (Eta $yellow[%i] minutes)" 42.33 5
colorprintfn "$white;blue[%s ]$black;white[%s ]$white;red[%s]" "La vie" "est" "belle"

Displays :

Demo

Thanks