The chlorophyll Reference Manual

This is the chlorophyll Reference Manual, version 0.0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Wed Mar 15 04:33:54 2023 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 chlorophyll

ANSI escape code library for Common Lisp

Author

Mikhail Gorozhin <>

License

Expat

Long Description

‘chlorophyll‘ is a ANSI escape code library for Common Lisp.

## Installation
### Quicklisp
Coming soon.

### Ultralisp
Set up [Ultralisp](https://ultralisp.org/), load ‘chlorophyll‘:

“‘common-lisp
(ql:quickload "chlorophyll")
“‘

## Usage

“‘common-lisp
(let ((very-peri (chlorophyll:create-rgb-color 102 103 171)) (hot-pink (chlorophyll:create-rgb-color 255 105 180))) (format t "~A~%~A~%" (chlorophyll:overline "overline text") (chlorophyll:stylize (chlorophyll:new-style
:bold t
:foreground hot-pink
:background very-peri)
"beautiful text")))
“‘

Version

0.0.1

Dependency

alexandria (system).

Source

chlorophyll.asd.

Child Component

src (module).


3 Modules

Modules are listed depth-first from the system components tree.


3.1 chlorophyll/src

Source

chlorophyll.asd.

Parent Component

chlorophyll (system).

Child Components

4 Files

Files are sorted by type and then listed depth-first from the systems components trees.


4.1 Lisp


4.1.1 chlorophyll/chlorophyll.asd

Source

chlorophyll.asd.

Parent Component

chlorophyll (system).

ASDF Systems

chlorophyll.

Packages

chlorophyll-asd.


4.1.2 chlorophyll/src/package.lisp

Source

chlorophyll.asd.

Parent Component

src (module).

Packages

chlorophyll.


4.1.3 chlorophyll/src/color.lisp

Source

chlorophyll.asd.

Parent Component

src (module).

Public Interface
Internals

4.1.4 chlorophyll/src/style.lisp

Source

chlorophyll.asd.

Parent Component

src (module).

Public Interface
Internals

4.1.5 chlorophyll/src/positioning.lisp

Source

chlorophyll.asd.

Parent Component

src (module).

Public Interface

5 Packages

Packages are listed by definition order.


5.1 chlorophyll

Source

package.lisp.

Use List
  • alexandria.
  • common-lisp.
Public Interface
Internals

5.2 chlorophyll-asd

Source

chlorophyll.asd.

Use List
  • asdf/interface.
  • common-lisp.

6 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


6.1 Public Interface


6.1.1 Ordinary functions

Function: background (color str)

Eloquent constructor setting BACKGROUND

Package

chlorophyll.

Source

style.lisp.

Eloquent constructor setting BLINK

Package

chlorophyll.

Source

style.lisp.

Function: bold (str)

Eloquent constructor setting BOLD

Package

chlorophyll.

Source

style.lisp.

Function: create-ansi-256-color (color-id)

Constructor for an ANSI-256-COLOR

Package

chlorophyll.

Source

color.lisp.

Function: create-no-color ()

Constructor for an NO-COLOR

Package

chlorophyll.

Source

color.lisp.

Function: create-rgb-color (red green blue)

Constructor for an RGB-COLOR

Package

chlorophyll.

Source

color.lisp.

Function: crossout (str)

Eloquent constructor setting CROSSOUT

Package

chlorophyll.

Source

style.lisp.

Function: cursor-backward (&key n stream)

Moves cursor N columns backward

Package

chlorophyll.

Source

positioning.lisp.

Function: cursor-down (&key n stream)

Moves cursor N rows down

Package

chlorophyll.

Source

positioning.lisp.

Function: cursor-forward (&key n stream)

Moves cursor N columns forward

Package

chlorophyll.

Source

positioning.lisp.

Function: cursor-next-line (&key n stream)

Moves cursor to beginning of the line n lines up

Package

chlorophyll.

Source

positioning.lisp.

Function: cursor-previous-line (&key n stream)

Moves cursor to beginning of the line n lines down

Package

chlorophyll.

Source

positioning.lisp.

Function: cursor-up (&key n stream)

Moves cursor N rows up

Package

chlorophyll.

Source

positioning.lisp.

Function: faint (str)

Eloquent constructor setting FAINT

Package

chlorophyll.

Source

style.lisp.

Function: foreground (color str)

Eloquent constructor setting FOREGROUND

Package

chlorophyll.

Source

style.lisp.

Function: invert (str)

Eloquent constructor setting INVERT

Package

chlorophyll.

Source

style.lisp.

Function: italic (str)

Eloquent constructor setting ITALIC

Package

chlorophyll.

Source

style.lisp.

Function: move-cursor (row column &key stream)

Moves cursor to desired position

Package

chlorophyll.

Source

positioning.lisp.

Function: new-style (&key bold faint italic underline blink invert crossout overline foreground background)

Constructor for a STYLE

Package

chlorophyll.

Source

style.lisp.

Function: overline (str)

Eloquent constructor setting OVERLINE

Package

chlorophyll.

Source

style.lisp.

Function: restore-cursor-position (&key stream)

Restores the cursor position

Package

chlorophyll.

Source

positioning.lisp.

Function: save-cursor-position (&key stream)

Saves current cursor position

Package

chlorophyll.

Source

positioning.lisp.

Function: underline (str)

Eloquent constructor setting UNDERLINE

Package

chlorophyll.

Source

style.lisp.


6.1.2 Generic functions

Generic Function: stylize (s str)
Package

chlorophyll.

Methods
Method: stylize ((s style) (str string))

Applies STYLE to STR returning a new string

Source

style.lisp.


6.2 Internals


6.2.1 Constants

Constant: +background+

ANSI defined constant for a foreground color

Package

chlorophyll.

Source

style.lisp.

ANSI defined constant for blinking text

Package

chlorophyll.

Source

style.lisp.

Constant: +bold+

ANSI defined constant for bold text

Package

chlorophyll.

Source

style.lisp.

Constant: +crossout+

ANSI defined constant for crossedout text

Package

chlorophyll.

Source

style.lisp.

Constant: +faint+

ANSI defined constant for faint text

Package

chlorophyll.

Source

style.lisp.

Constant: +foreground+

ANSI defined constant for a background color

Package

chlorophyll.

Source

style.lisp.

Constant: +invert+

ANSI defined constant for inverted colors

Package

chlorophyll.

Source

style.lisp.

Constant: +italic+

ANSI defined constant for italic text

Package

chlorophyll.

Source

style.lisp.

Constant: +overline+

ANSI defined constant for an overlined text

Package

chlorophyll.

Source

style.lisp.

Constant: +reset+

ANSI defined constant for a reset action

Package

chlorophyll.

Source

style.lisp.

Constant: +underline+

ANSI defined constant for an underlined text

Package

chlorophyll.

Source

style.lisp.


6.2.2 Generic functions

Generic Reader: blinkp (object)
Package

chlorophyll.

Methods
Reader Method: blinkp ((style style))

Defines whether text should blink

Source

style.lisp.

Target Slot

blink.

Generic Reader: blue (object)
Generic Writer: (setf blue) (object)
Package

chlorophyll.

Methods
Reader Method: blue ((rgb-color rgb-color))
Writer Method: (setf blue) ((rgb-color rgb-color))

Amount of BLUE in color

Source

color.lisp.

Target Slot

blue.

Generic Reader: boldp (object)
Package

chlorophyll.

Methods
Reader Method: boldp ((style style))

Defines whether text should be bold

Source

style.lisp.

Target Slot

bold.

Generic Reader: color-id (object)
Generic Writer: (setf color-id) (object)
Package

chlorophyll.

Methods
Reader Method: color-id ((ansi-256-color ansi-256-color))
Writer Method: (setf color-id) ((ansi-256-color ansi-256-color))

Position in a predefined set of colors

Source

color.lisp.

Target Slot

color-id.

Generic Reader: crossoutp (object)
Package

chlorophyll.

Methods
Reader Method: crossoutp ((style style))

automatically generated reader method

Source

style.lisp.

Target Slot

crossout.

Generic Reader: faintp (object)
Package

chlorophyll.

Methods
Reader Method: faintp ((style style))

Defines whether text should be faint

Source

style.lisp.

Target Slot

faint.

Generic Reader: get-background (object)
Package

chlorophyll.

Methods
Reader Method: get-background ((style style))

Defines a background color for the text

Source

style.lisp.

Target Slot

background.

Generic Reader: get-foreground (object)
Package

chlorophyll.

Methods
Reader Method: get-foreground ((style style))

Defines a foreground color for the text

Source

style.lisp.

Target Slot

foreground.

Generic Reader: green (object)
Generic Writer: (setf green) (object)
Package

chlorophyll.

Methods
Reader Method: green ((rgb-color rgb-color))
Writer Method: (setf green) ((rgb-color rgb-color))

Amount of GREEN in color

Source

color.lisp.

Target Slot

green.

Generic Reader: invertp (object)
Package

chlorophyll.

Methods
Reader Method: invertp ((style style))

Defines whether text should have inverted foreground/background

Source

style.lisp.

Target Slot

invert.

Generic Reader: italicp (object)
Package

chlorophyll.

Methods
Reader Method: italicp ((style style))

Defines whether text should be italic

Source

style.lisp.

Target Slot

italic.

Generic Reader: overlinep (object)
Package

chlorophyll.

Methods
Reader Method: overlinep ((style style))

Defines whether text should be overlined

Source

style.lisp.

Target Slot

overline.

Generic Reader: red (object)
Generic Writer: (setf red) (object)
Package

chlorophyll.

Methods
Reader Method: red ((rgb-color rgb-color))
Writer Method: (setf red) ((rgb-color rgb-color))

Amount of RED in color

Source

color.lisp.

Target Slot

red.

Generic Function: to-sequence (color)
Package

chlorophyll.

Methods
Method: to-sequence ((color rgb-color))

Converts RGB-COLOR to a ANSI escape sequence color definition

Source

style.lisp.

Method: to-sequence ((color ansi-256-color))

Converts ANSI-256-COLOR to a ANSI escape sequence color definition

Source

style.lisp.

Method: to-sequence ((color no-color))

Converts NO-COLOR to a ANSI escape sequence color definition

Source

style.lisp.

Generic Reader: underlinep (object)
Package

chlorophyll.

Methods
Reader Method: underlinep ((style style))

Defines whether text should be underlined

Source

style.lisp.

Target Slot

underline.


6.2.3 Classes

Class: ansi-256-color

Represents a color from predefined ANSI set of colors

Package

chlorophyll.

Source

color.lisp.

Direct superclasses

color.

Direct methods
Direct slots
Slot: color-id

Position in a predefined set of colors

Type

(integer 0 255)

Initargs

:color-id

Readers

color-id.

Writers

(setf color-id).

Class: color

Base class representing color, not to be used directly

Package

chlorophyll.

Source

color.lisp.

Direct subclasses
Class: no-color

NOOP color class, not representing any real color

Package

chlorophyll.

Source

color.lisp.

Direct superclasses

color.

Direct methods

to-sequence.

Class: rgb-color

Represents a 24-bit RGB color

Package

chlorophyll.

Source

color.lisp.

Direct superclasses

color.

Direct methods
Direct slots
Slot: red

Amount of RED in color

Type

(integer 0 255)

Initargs

:red

Readers

red.

Writers

(setf red).

Slot: green

Amount of GREEN in color

Type

(integer 0 255)

Initargs

:green

Readers

green.

Writers

(setf green).

Slot: blue

Amount of BLUE in color

Type

(integer 0 255)

Initargs

:blue

Readers

blue.

Writers

(setf blue).

Class: style

Represents a styleset appliable for the text

Package

chlorophyll.

Source

style.lisp.

Direct methods
Direct slots
Slot: bold

Defines whether text should be bold

Type

boolean

Initargs

:bold

Readers

boldp.

Writers

This slot is read-only.

Slot: faint

Defines whether text should be faint

Type

boolean

Initargs

:faint

Readers

faintp.

Writers

This slot is read-only.

Slot: italic

Defines whether text should be italic

Type

boolean

Initargs

:italic

Readers

italicp.

Writers

This slot is read-only.

Slot: underline

Defines whether text should be underlined

Type

boolean

Initargs

:underline

Readers

underlinep.

Writers

This slot is read-only.

Defines whether text should blink

Type

boolean

Initargs

:blink

Readers

blinkp.

Writers

This slot is read-only.

Slot: invert

Defines whether text should have inverted foreground/background

Type

boolean

Initargs

:invert

Readers

invertp.

Writers

This slot is read-only.

Slot: crossout
Type

boolean

Initargs

:crossout

Readers

crossoutp.

Writers

This slot is read-only.

Slot: overline

Defines whether text should be overlined

Type

boolean

Initargs

:overline

Readers

overlinep.

Writers

This slot is read-only.

Slot: foreground

Defines a foreground color for the text

Type

(or chlorophyll::color null)

Initargs

:foreground

Readers

get-foreground.

Writers

This slot is read-only.

Slot: background

Defines a background color for the text

Type

(or chlorophyll::color null)

Initargs

:background

Readers

get-background.

Writers

This slot is read-only.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (  
B   C   F   G   I   M   N   O   R   S   T   U  
Index Entry  Section

(
(setf blue): Private generic functions
(setf blue): Private generic functions
(setf color-id): Private generic functions
(setf color-id): Private generic functions
(setf green): Private generic functions
(setf green): Private generic functions
(setf red): Private generic functions
(setf red): Private generic functions

B
background: Public ordinary functions
blink: Public ordinary functions
blinkp: Private generic functions
blinkp: Private generic functions
blue: Private generic functions
blue: Private generic functions
bold: Public ordinary functions
boldp: Private generic functions
boldp: Private generic functions

C
color-id: Private generic functions
color-id: Private generic functions
create-ansi-256-color: Public ordinary functions
create-no-color: Public ordinary functions
create-rgb-color: Public ordinary functions
crossout: Public ordinary functions
crossoutp: Private generic functions
crossoutp: Private generic functions
cursor-backward: Public ordinary functions
cursor-down: Public ordinary functions
cursor-forward: Public ordinary functions
cursor-next-line: Public ordinary functions
cursor-previous-line: Public ordinary functions
cursor-up: Public ordinary functions

F
faint: Public ordinary functions
faintp: Private generic functions
faintp: Private generic functions
foreground: Public ordinary functions
Function, background: Public ordinary functions
Function, blink: Public ordinary functions
Function, bold: Public ordinary functions
Function, create-ansi-256-color: Public ordinary functions
Function, create-no-color: Public ordinary functions
Function, create-rgb-color: Public ordinary functions
Function, crossout: Public ordinary functions
Function, cursor-backward: Public ordinary functions
Function, cursor-down: Public ordinary functions
Function, cursor-forward: Public ordinary functions
Function, cursor-next-line: Public ordinary functions
Function, cursor-previous-line: Public ordinary functions
Function, cursor-up: Public ordinary functions
Function, faint: Public ordinary functions
Function, foreground: Public ordinary functions
Function, invert: Public ordinary functions
Function, italic: Public ordinary functions
Function, move-cursor: Public ordinary functions
Function, new-style: Public ordinary functions
Function, overline: Public ordinary functions
Function, restore-cursor-position: Public ordinary functions
Function, save-cursor-position: Public ordinary functions
Function, underline: Public ordinary functions

G
Generic Function, (setf blue): Private generic functions
Generic Function, (setf color-id): Private generic functions
Generic Function, (setf green): Private generic functions
Generic Function, (setf red): Private generic functions
Generic Function, blinkp: Private generic functions
Generic Function, blue: Private generic functions
Generic Function, boldp: Private generic functions
Generic Function, color-id: Private generic functions
Generic Function, crossoutp: Private generic functions
Generic Function, faintp: Private generic functions
Generic Function, get-background: Private generic functions
Generic Function, get-foreground: Private generic functions
Generic Function, green: Private generic functions
Generic Function, invertp: Private generic functions
Generic Function, italicp: Private generic functions
Generic Function, overlinep: Private generic functions
Generic Function, red: Private generic functions
Generic Function, stylize: Public generic functions
Generic Function, to-sequence: Private generic functions
Generic Function, underlinep: Private generic functions
get-background: Private generic functions
get-background: Private generic functions
get-foreground: Private generic functions
get-foreground: Private generic functions
green: Private generic functions
green: Private generic functions

I
invert: Public ordinary functions
invertp: Private generic functions
invertp: Private generic functions
italic: Public ordinary functions
italicp: Private generic functions
italicp: Private generic functions

M
Method, (setf blue): Private generic functions
Method, (setf color-id): Private generic functions
Method, (setf green): Private generic functions
Method, (setf red): Private generic functions
Method, blinkp: Private generic functions
Method, blue: Private generic functions
Method, boldp: Private generic functions
Method, color-id: Private generic functions
Method, crossoutp: Private generic functions
Method, faintp: Private generic functions
Method, get-background: Private generic functions
Method, get-foreground: Private generic functions
Method, green: Private generic functions
Method, invertp: Private generic functions
Method, italicp: Private generic functions
Method, overlinep: Private generic functions
Method, red: Private generic functions
Method, stylize: Public generic functions
Method, to-sequence: Private generic functions
Method, to-sequence: Private generic functions
Method, to-sequence: Private generic functions
Method, underlinep: Private generic functions
move-cursor: Public ordinary functions

N
new-style: Public ordinary functions

O
overline: Public ordinary functions
overlinep: Private generic functions
overlinep: Private generic functions

R
red: Private generic functions
red: Private generic functions
restore-cursor-position: Public ordinary functions

S
save-cursor-position: Public ordinary functions
stylize: Public generic functions
stylize: Public generic functions

T
to-sequence: Private generic functions
to-sequence: Private generic functions
to-sequence: Private generic functions
to-sequence: Private generic functions

U
underline: Public ordinary functions
underlinep: Private generic functions
underlinep: Private generic functions


A.3 Variables

Jump to:   +  
B   C   F   G   I   O   R   S   U  
Index Entry  Section

+
+background+: Private constants
+blink+: Private constants
+bold+: Private constants
+crossout+: Private constants
+faint+: Private constants
+foreground+: Private constants
+invert+: Private constants
+italic+: Private constants
+overline+: Private constants
+reset+: Private constants
+underline+: Private constants

B
background: Private classes
blink: Private classes
blue: Private classes
bold: Private classes

C
color-id: Private classes
Constant, +background+: Private constants
Constant, +blink+: Private constants
Constant, +bold+: Private constants
Constant, +crossout+: Private constants
Constant, +faint+: Private constants
Constant, +foreground+: Private constants
Constant, +invert+: Private constants
Constant, +italic+: Private constants
Constant, +overline+: Private constants
Constant, +reset+: Private constants
Constant, +underline+: Private constants
crossout: Private classes

F
faint: Private classes
foreground: Private classes

G
green: Private classes

I
invert: Private classes
italic: Private classes

O
overline: Private classes

R
red: Private classes

S
Slot, background: Private classes
Slot, blink: Private classes
Slot, blue: Private classes
Slot, bold: Private classes
Slot, color-id: Private classes
Slot, crossout: Private classes
Slot, faint: Private classes
Slot, foreground: Private classes
Slot, green: Private classes
Slot, invert: Private classes
Slot, italic: Private classes
Slot, overline: Private classes
Slot, red: Private classes
Slot, underline: Private classes

U
underline: Private classes