colourista-0.1.0.0: Convenient interface for printing colourful messages

Copyright(c) 2020 Kowainik
LicenseMPL-2.0
MaintainerKowainik <xrom.xkov@gmail.com>
Safe HaskellNone
LanguageHaskell2010

Colourista.Pure

Contents

Description

This module introduces helpful pure codes to customise the terminal output view.

Synopsis

Documentation

formatWith :: (IsString str, Semigroup str) => [str] -> str -> str Source #

General purpose function to format strings with multiple options. If this function takes empty list as an argument, no formatting is applied.

Some typical usages include but not limited to:

  1. Green text: formatWith [green] myString
  2. Bold red text: formatWith [bold, red] myString
  3. Blue text on white background: formatWith [blue, whiteBg] myString
  4. Italicized yellow on cyan background: formatWith [italic, yellow, cyanBg] myString

⚠ Caution: Double underlining doubleUnderline is not widely supported. It is also not natively supported on Windows 10.

Colour

red :: IsString str => str Source #

Code to apply Red colouring for the terminal output.

green :: IsString str => str Source #

Code to apply Green colouring for the terminal output.

blue :: IsString str => str Source #

Code to apply Blue colouring for the terminal output.

yellow :: IsString str => str Source #

Code to apply Yellow colouring for the terminal output.

black :: IsString str => str Source #

Code to apply Black colouring for the terminal output.

white :: IsString str => str Source #

Code to apply White colouring for the terminal output.

magenta :: IsString str => str Source #

Code to apply Magenta colouring for the terminal output.

cyan :: IsString str => str Source #

Code to apply Cyan colouring for the terminal output.

Background

redBg :: IsString str => str Source #

Code to apply Red background colouring for the terminal output.

greenBg :: IsString str => str Source #

Code to apply Green background colouring for the terminal output.

blueBg :: IsString str => str Source #

Code to apply Blue background colouring for the terminal output.

yellowBg :: IsString str => str Source #

Code to apply Yellow background colouring for the terminal output.

blackBg :: IsString str => str Source #

Code to apply Black background colouring for the terminal output.

whiteBg :: IsString str => str Source #

Code to apply White background colouring for the terminal output.

magentaBg :: IsString str => str Source #

Code to apply Magenta background colouring for the terminal output.

cyanBg :: IsString str => str Source #

Code to apply Cyan background colouring for the terminal output.

Emphasis

bold :: IsString str => str Source #

Code to apply bold emphasis for the terminal output.

italic :: IsString str => str Source #

Code to apply italic emphasis for the terminal output.

underline :: IsString str => str Source #

Code to apply underline emphasis for the terminal output.

doubleUnderline :: IsString str => str Source #

Code to apply double underline emphasis for the terminal output.

⚠ Caution: This is not widely supported. It is not natively supported on Windows 10

noUnderline :: IsString str => str Source #

Code to apply no underline emphasis for the terminal output.

indent :: (IsString str, Semigroup str) => Int -> str Source #

Code to indent the terminal output by the given amount of spaces.

Reset

reset :: IsString str => str Source #

Code to reset all previous code applied for the terminal output.