paint-2.0.0: Colorization of text for command-line output

Copyright(c) 2017-2020 Daniel Lovasko
LicenseBSD2
MaintainerDaniel Lovasko <daniel.lovasko@gmail.com>
Stabilitystable
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Text.Paint

Contents

Description

 
Synopsis

Documentation

data Color Source #

Foreground and background color.

Constructors

Black

black

Maroon

maroon

Green

green

Olive

olive

Navy

navy

Purple

purple

Teal

teal

Silver

silver

Gray

gray

Red

red

Lime

lime

Yellow

yellow

Blue

blue

Fuchsia

fuchsia

Aqua

aqua

White

white

Default

default

Instances
Enum Color Source # 
Instance details

Defined in Text.Paint

Eq Color Source # 
Instance details

Defined in Text.Paint

Methods

(==) :: Color -> Color -> Bool #

(/=) :: Color -> Color -> Bool #

Ord Color Source # 
Instance details

Defined in Text.Paint

Methods

compare :: Color -> Color -> Ordering #

(<) :: Color -> Color -> Bool #

(<=) :: Color -> Color -> Bool #

(>) :: Color -> Color -> Bool #

(>=) :: Color -> Color -> Bool #

max :: Color -> Color -> Color #

min :: Color -> Color -> Color #

Show Color Source # 
Instance details

Defined in Text.Paint

Methods

showsPrec :: Int -> Color -> ShowS #

show :: Color -> String #

showList :: [Color] -> ShowS #

data Flag Source #

Various flags applicable to the text.

Constructors

Bold

bold text (sometimes lighter)

Underline

underlined text

Blink

blinking (<150 BPM)

Instances
Eq Flag Source # 
Instance details

Defined in Text.Paint

Methods

(==) :: Flag -> Flag -> Bool #

(/=) :: Flag -> Flag -> Bool #

Ord Flag Source # 
Instance details

Defined in Text.Paint

Methods

compare :: Flag -> Flag -> Ordering #

(<) :: Flag -> Flag -> Bool #

(<=) :: Flag -> Flag -> Bool #

(>) :: Flag -> Flag -> Bool #

(>=) :: Flag -> Flag -> Bool #

max :: Flag -> Flag -> Flag #

min :: Flag -> Flag -> Flag #

Show Flag Source # 
Instance details

Defined in Text.Paint

Methods

showsPrec :: Int -> Flag -> ShowS #

show :: Flag -> String #

showList :: [Flag] -> ShowS #

data Paint Source #

Coloring scheme containing foreground and background layers, and a setting for text styling.

Constructors

Paint Color Color [Flag] 
Instances
Eq Paint Source # 
Instance details

Defined in Text.Paint

Methods

(==) :: Paint -> Paint -> Bool #

(/=) :: Paint -> Paint -> Bool #

Ord Paint Source # 
Instance details

Defined in Text.Paint

Methods

compare :: Paint -> Paint -> Ordering #

(<) :: Paint -> Paint -> Bool #

(<=) :: Paint -> Paint -> Bool #

(>) :: Paint -> Paint -> Bool #

(>=) :: Paint -> Paint -> Bool #

max :: Paint -> Paint -> Paint #

min :: Paint -> Paint -> Paint #

Show Paint Source # 
Instance details

Defined in Text.Paint

Methods

showsPrec :: Int -> Paint -> ShowS #

show :: Paint -> String #

showList :: [Paint] -> ShowS #

paint Source #

Arguments

:: Paint

coloring scheme

-> String

plain text

-> String

colorized text

Apply a color scheme to a text instance.