You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/ansi.rst
+10-9Lines changed: 10 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,18 +17,19 @@ Constants and Functions
17
17
18
18
``compose`` is built on top of a large number of underlying functions and constants.
19
19
20
+
ANSI supports eight named colors, each with a bright variant.
20
21
For each of the supported colors (black, red, green, yellow, blue, magenta, cyan, and white) there will be four functions and four constants:
21
22
22
-
* *color* - function to set text color
23
-
* *color*-bg - function to set background color
24
-
* bright-*color* - function to set enable bright text and the text color
25
-
* bright-*color*-bg - function to enable bright text and the background color
26
-
* *color*-font - constant that enables the text color
27
-
* *color*-bg-font - constant that enables the color as background
28
-
* bright-*color*-font - constant that enables the text color in bright
29
-
* bright-*color*-bg-font - constant that enables the bright color as background
23
+
* [bright-] *color* - function to set foreground text color
24
+
* [bright-] *color*-bg - function to set background color
25
+
* [bright-] *color*-font - constant that enables the text color
26
+
* [bright-] *color*-bg-font - constant that enables the color as background
30
27
31
-
The functions are passed a string and wrap the string with ANSI codes to enable an ANSI graphic representation for the text, with a reset after the text.
28
+
For example, for the color green there will be ``green``, ``green-bg``, ``bright-green``, and ``bright-green-bg`` functions,
29
+
and constants ``green-font``, ``green-bg-font``, ``bright-green-font``, and ``bright-green-bg-font``.
30
+
31
+
The functions are passed a string and wrap the string with ANSI codes to enable the font characteristics, with
32
+
a reset after the string.
32
33
33
34
Note that the exact color interpretation of the ANSI codes varies significantly between platforms and applications, and
0 commit comments