Skip to content

Commit

Permalink
fix: readme svg
Browse files Browse the repository at this point in the history
  • Loading branch information
pd93 committed Aug 4, 2024
1 parent 29f5897 commit 2275c98
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 14 deletions.
27 changes: 13 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<p style="width:100%;text-align:center;font-size:40px;margin-bottom:30px;letter-spacing:5px;font-family:consolas;">
<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>
</p>
<div style="width: 100%;">
<img src="res/title.svg" style="width: 100%;" alt="Click to see the source">
</div>

<p style="width:100%;text-align:center;margin-bottom:30px;font-style:italic;">
A simple, lightweight Golang package for working with ANSI escape codes.
<p align="center">
<i>A simple, lightweight Golang package for working with ANSI escape codes.</i>
</p>
<br>

If you've ever worked on a CLI application before, you probably know the
struggle of working with ANSI escape codes. Often, you just want to quickly
Expand All @@ -18,9 +19,7 @@ dependencies :package: It allows you to quickly apply styles to strings using
need to call a function for each style, making it easy to apply/reset multiple
styles to a single string.

With `ansi`, the mess at the top of this page becomes: <span style="font-size:20px;letter-spacing:2px;font-family:consolas;">
<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>
</span>
With `ansi`, the mess at the top of this page becomes: <img src="res/ansi.svg" alt="Click to see the source">

## Usage

Expand Down Expand Up @@ -66,11 +65,11 @@ For more info, check out the [style reference](#style-reference) below or take a

### Formatting

| Code | ANSI Code | Example |
| Code | ANSI Code | Description |
| -------------- | --------: | ------------------------------------------------------------------------------------------------------------- |
| `bold` | `1` | <span style="font-weight:bold;">Sets the font weight to bold</span> |
| `bold` | `1` | **Sets the font weight to bold** |
| `faint`, `dim` | `2` | <span style="color:#d3d7cf;">Sets the text brightness to its faint/dim variant</span> \* |
| `italic` | `3` | <span style="font-style:italic;">Sets the font style to italic</span> |
| `italic` | `3` | _Sets the font style to italic_ |
| `underline` | `4` | <span style="text-decoration:underline;">Sets the text decoration to underline</span> |
| `blink` | `5` | <span style="text-decoration:blink;">Sets the text to blink in and out</span> |
| `invert` | `7` | <span style="backdrop-filter:invert(1);filter:invert(1);">Inverts the foreground and background colors</span> |
Expand All @@ -79,7 +78,7 @@ For more info, check out the [style reference](#style-reference) below or take a

> \* `faint` and `dim` do not work when using 8-bit (256) or 24-bit (RGB) color modes.
| Code | ANSI Code | Example |
| Code | ANSI Code | Description |
| ---------------- | --------: | --------------------------------------- |
| `/bold` | `22` | Resets the font weight \*\* |
| `/faint`, `/dim` | `22` | Resets the text brightness \*\* |
Expand All @@ -95,7 +94,7 @@ For more info, check out the [style reference](#style-reference) below or take a
### Foreground Colors

| Code | ANSI Code | Reset Code |
| Code | ANSI Code | Description |
| --------- | -----------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `black` | `30` | <span style="color:#555753;">Sets the text foreground to black</span> |
| `red` | `31` | <span style="color:#ef2929;">Sets the text foreground to red</span> |
Expand All @@ -111,7 +110,7 @@ For more info, check out the [style reference](#style-reference) below or take a

### Background Colors

| Code | ANSI Code | Reset Code |
| Code | ANSI Code | Description |
| ------------ | -----------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `bg-black` | `40` | <span style="background-color:#555753;">Sets the text background to black</span> |
| `bg-red` | `41` | <span style="background-color:#ef2929;">Sets the text background to red</span> |
Expand Down
Empty file removed go.sum
Empty file.
41 changes: 41 additions & 0 deletions res/ansi.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 43 additions & 0 deletions res/title.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2275c98

Please sign in to comment.