Functions to wrap strings in ANSI Escape sequences for colors and styling.
Make the text darker.
This can be used with other text modifiers, such as color.
import Console exposing (dark, green)
-- "Hello, dark green world!" with "dark green" in dark green
greeting : String
greeting =
"Hello, " ++ (dark << green) "dark green" ++ " world!"Not all terminals support this.
Make the text bold.
This can be used with other text modifiers, such as color.
import Console exposing (blue, bold)
-- "Hello, bold blue world!" with "bold blue" in bold and blue
greeting : String
greeting =
"Hello, " ++ (bold << blue) "bold blue" ++ " world!"Some terminals implement this as a color change rather than a boldness change.
Make the text underlined.
This can be used with other text modifiers, such as color.
import Console exposing (underline)
-- "This will look like a hyperlink" with "hyperlink" underlined
example : String
example =
"This will look like a " ++ underline "hyperlink"Not all terminals support this.
Invert the foreground and background colors from what they would otherwise be.
Make the foreground text black.
Make the foreground text red.
Make the foreground text green.
Make the foreground text yellow.
Make the foreground text blue.
Make the foreground text magenta.
Make the foreground text cyan.
Make the foreground text white.
Make the background black.
Make the background red.
Make the background green.
Make the background yellow.
Make the background blue.
Make the background magenta.
Make the background cyan.
Make the background white.
Display the text in the console's default style.