colourista-0.0.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

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.

Reset

reset :: IsString str => str Source #

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