Karya, built on 2020-11-26T21:03:17 (patch 23b5be2d53a9e8e7d6136cda5aae2849abe5cded)
Safe HaskellNone

Util.Styled

Contents

Description

A simple Styled Text implementation. There are a few others on hackage (terminal-text, rainbow, ...), but they're all too complicated for me.

Examples: > printLn $ fgs (bright red) "hi" <> fgs red "there" > printLn $ bgs (bright red) "hi" <> bgs red "there" > printLn $ underlines "hi" <> " " <> bolds "there" > printLn $ underlines $ fgs (bright red) "hi" <> fgs red "there"

printLn $ bgs cyan "hello\nthere"
printLn $ bgs cyan "hello" <> "\n" <> bgs cyan "there"
Synopsis

Documentation

data Styled Source #

Instances

Instances details
Eq Styled # 
Instance details

Defined in Util.Styled

Methods

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

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

Show Styled # 
Instance details

Defined in Util.Styled

String.IsString Styled # 
Instance details

Defined in Util.Styled

Semigroup Styled # 
Instance details

Defined in Util.Styled

Monoid Styled # 
Instance details

Defined in Util.Styled

data Style Source #

Constructors

Style 

Instances

Instances details
Eq Style # 
Instance details

Defined in Util.Styled

Methods

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

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

Show Style # 
Instance details

Defined in Util.Styled

Semigroup Style # 
Instance details

Defined in Util.Styled

Methods

(<>) :: Style -> Style -> Style #

sconcat :: NonEmpty Style -> Style #

stimes :: Integral b => b -> Style -> Style #

Monoid Style # 
Instance details

Defined in Util.Styled

Methods

mempty :: Style #

mappend :: Style -> Style -> Style #

mconcat :: [Style] -> Style #

data Color Source #

Constructors

Ansi !AnsiColor 
Rgb !RgbColor 

Instances

Instances details
Eq Color # 
Instance details

Defined in Util.Styled

Methods

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

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

Show Color # 
Instance details

Defined in Util.Styled

data RgbColor Source #

Instances

Instances details
Eq RgbColor # 
Instance details

Defined in Util.Styled

Show RgbColor # 
Instance details

Defined in Util.Styled

data AnsiColor Source #

Instances

Instances details
Eq AnsiColor # 
Instance details

Defined in Util.Styled

Show AnsiColor # 
Instance details

Defined in Util.Styled

fg :: ToStyled a => Color -> a -> Styled Source #

bg :: ToStyled a => Color -> a -> Styled Source #

bold :: ToStyled a => a -> Styled Source #

underline :: ToStyled a => a -> Styled Source #

text util