1
- <p style =" width :100% ; text-align : center ; font-size : 40 px ; margin-bottom : 30 px ; letter-spacing : 5 px ; font-family :consolas ;" >
2
- < span style = " color : #ad7fa8 ; " >\x1b</ span >< span style = " color : #729fcf ; " > [ </ span >< span style = " color : #8ae234 ; " >1;43</ span >< span style = " color : #ef2929 ; " >m</ span >< span style =" font-weight : bold ; background-color : #fce94f ; color : #555753 ; " >ANSI</ span >< span style = " color : #ad7fa8 ; " >\x1b</ span >< span style = " color : #729fcf ; " > [ </ span >< span style = " color : #8ae234 ; " >0</ span >< span style = " color : #ef2929 ; " >m</ span >
3
- </p >
1
+ <div style =" width : 100% ;" >
2
+ < img src = " res/title.svg " style =" width : 100 % ; " alt = " Click to see the source " >
3
+ </div >
4
4
5
- <p style = " width : 100 % ; text-align : center ; margin-bottom : 30 px ; font-style : italic ; " >
6
- A simple, lightweight Golang package for working with ANSI escape codes.
5
+ <p align = " center " >
6
+ < i > A simple, lightweight Golang package for working with ANSI escape codes.</ i >
7
7
</p >
8
+ <br >
8
9
9
10
If you've ever worked on a CLI application before, you probably know the
10
11
struggle of working with ANSI escape codes. Often, you just want to quickly
@@ -18,9 +19,7 @@ dependencies :package: It allows you to quickly apply styles to strings using
18
19
need to call a function for each style, making it easy to apply/reset multiple
19
20
styles to a single string.
20
21
21
- With ` ansi ` , the mess at the top of this page becomes: <span style =" font-size :20px ;letter-spacing :2px ;font-family :consolas;" >
22
- <span style =" color :#ad7fa8 ;" >[ </span ><span style =" color :#8ae234 ;" >bold: bg-yellow </span ><span style =" color :#ad7fa8 ;" >] </span ><span style =" font-weight :bold ;background-color :#fce94f ;color :#555753 ;" >ANSI</span ><span style =" color :#ad7fa8 ;" >[ </span ><span style =" color :#ef2929 ;" >/</span ><span style =" color :#ad7fa8 ;" >] </span >
23
- </span >
22
+ With ` ansi ` , the mess at the top of this page becomes: <img src =" res/ansi.svg " alt =" Click to see the source " >
24
23
25
24
## Usage
26
25
@@ -66,11 +65,11 @@ For more info, check out the [style reference](#style-reference) below or take a
66
65
67
66
### Formatting
68
67
69
- | Code | ANSI Code | Example |
68
+ | Code | ANSI Code | Description |
70
69
| -------------- | --------: | ------------------------------------------------------------------------------------------------------------- |
71
- | ` bold ` | ` 1 ` | < span style = " font-weight : bold ; " > Sets the font weight to bold</ span > |
70
+ | ` bold ` | ` 1 ` | ** Sets the font weight to bold** |
72
71
| ` faint ` , ` dim ` | ` 2 ` | <span style =" color :#d3d7cf ;" >Sets the text brightness to its faint/dim variant</span > \* |
73
- | ` italic ` | ` 3 ` | < span style = " font-style : italic ; " >Sets the font style to italic</ span > |
72
+ | ` italic ` | ` 3 ` | _ Sets the font style to italic _ |
74
73
| ` underline ` | ` 4 ` | <span style =" text-decoration :underline ;" >Sets the text decoration to underline</span > |
75
74
| ` blink ` | ` 5 ` | <span style =" text-decoration :blink ;" >Sets the text to blink in and out</span > |
76
75
| ` invert ` | ` 7 ` | <span style =" backdrop-filter :invert (1 );filter :invert (1 );" >Inverts the foreground and background colors</span > |
@@ -79,7 +78,7 @@ For more info, check out the [style reference](#style-reference) below or take a
79
78
80
79
> \* ` faint ` and ` dim ` do not work when using 8-bit (256) or 24-bit (RGB) color modes.
81
80
82
- | Code | ANSI Code | Example |
81
+ | Code | ANSI Code | Description |
83
82
| ---------------- | --------: | --------------------------------------- |
84
83
| ` /bold ` | ` 22 ` | Resets the font weight \*\* |
85
84
| ` /faint ` , ` /dim ` | ` 22 ` | Resets the text brightness \*\* |
@@ -95,7 +94,7 @@ For more info, check out the [style reference](#style-reference) below or take a
95
94
96
95
### Foreground Colors
97
96
98
- | Code | ANSI Code | Reset Code |
97
+ | Code | ANSI Code | Description |
99
98
| --------- | -----------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
100
99
| ` black ` | ` 30 ` | <span style =" color :#555753 ;" >Sets the text foreground to black</span > |
101
100
| ` red ` | ` 31 ` | <span style =" color :#ef2929 ;" >Sets the text foreground to red</span > |
@@ -111,7 +110,7 @@ For more info, check out the [style reference](#style-reference) below or take a
111
110
112
111
### Background Colors
113
112
114
- | Code | ANSI Code | Reset Code |
113
+ | Code | ANSI Code | Description |
115
114
| ------------ | -----------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
116
115
| ` bg-black ` | ` 40 ` | <span style =" background-color :#555753 ;" >Sets the text background to black</span > |
117
116
| ` bg-red ` | ` 41 ` | <span style =" background-color :#ef2929 ;" >Sets the text background to red</span > |
0 commit comments