Usage

Installation

npm install --save sgr-composer

Examples

import SGRcomposer from 'sgr-composer'

API

A representation of an in/out SGR code pair.

SGRColor

Type: object

Properties
in (string) : The opening SGR color code.
out (string) : The closing SGR code.

Style declaration

style

Type: object

Properties
background (boolean) : Set background color
bold (boolean) : Set bold
dim (boolean) : Set dim mode
italic (boolean) : Set italics
underline (boolean) : Set underline
blink (boolean) : Set blink
invert (boolean) : Set inverted video

setStyles Object

src/index.js

Set a style object/

setStyles(styles: style, excluded_: style) → Object
Parameters
styles (style) The style object to set
excluded_ (style) Styles to exclude.
Returns
Object: In and Out SGR parts

SGRcomposer

src/index.js

A Class for composing various SGR codes.

new SGRcomposer(targetDepth: (number | string), styles: style)

Type: SGRcomposer

Parameters
targetDepth ((number | string)) The target color depth.
styles (style) Additional SGR style codes.
Instance Members
depth
color
color
hex
red
green
blue
style
style
styleArray
sgr(exclusions)