basement-0.0.10: Foundation scrap box of array & string

LicenseBSD-style
MaintainerVincent Hanquez <vincent@snarc.org>
Safe HaskellNone
LanguageHaskell2010

Basement.Terminal.ANSI

Contents

Description

ANSI Terminal escape for cursor and attributes manipulations

On Unix system, it should be supported by most terminal emulators.

On Windows system, all escape sequences are empty for maximum compatibility purpose, and easy implementation. newer version of Windows 10 supports ANSI escape now, but we'll need some kind of detection.

Synopsis

Types

type Escape = String #

type ColorComponent = Zn64 8 #

Simple color component on 8 color terminal (maximum compatibility)

type GrayComponent = Zn64 24 #

Gray color compent on 256colors terminals

type RGBComponent = Zn64 6 #

Color compent on 256colors terminals

Simple ANSI escape factory functions

sgrReset :: Escape #

All attribute off

sgrForeground :: ColorComponent -> Bool -> Escape #

8 Colors + Bold attribute for foreground

sgrBackground :: ColorComponent -> Bool -> Escape #

8 Colors + Bold attribute for background

sgrForegroundColor216 #

Arguments

:: RGBComponent

Red component

-> RGBComponent

Green component

-> RGBComponent

Blue component

-> Escape 

sgrBackgroundColor216 #

Arguments

:: RGBComponent

Red component

-> RGBComponent

Green component

-> RGBComponent

Blue component

-> Escape