Skip to content

Commit 44d0d21

Browse files
committed
docs: add base color samples to readme
1 parent 4fdcab5 commit 44d0d21

17 files changed

+21
-21
lines changed

README.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Ansis is focused on [small size](#compare-size) and [speed](#benchmark) while pr
3333

3434
<a id="features" name="features"></a>
3535

36-
## 💡 Highlights
36+
## 💡 Features
3737

3838
- Supports **ESM**, **CommonJS**, **Bun**, **Deno**, **Next.JS**
3939
- Works in [Chromium-based](#browsers-compatibility) browsers such as **Chrome**, **Edge**, **Opera**, **Brave**, **Vivaldi**
@@ -112,7 +112,7 @@ The package size in `node_modules` directory:
112112
- `chalk`: Slower than both **Ansis** and **Picocolors** in all use cases.
113113

114114
> [!CAUTION]
115-
> **Picocolors** doesn't handle important **edge cases**, so it is the fastest and smallest.
115+
> **Picocolors** doesn't handle important **edge cases**, so it is the fastest.
116116
>
117117
> **Picocolors** is faster only in a [simple](#bench-simple) micro-benchmark, which does not reflect real world usage.\
118118
> In a more complex benchmark, **Ansis** is much [closer](#bench-picocolors-complex) to **Picocolors** results or even [faster](#bench-3-styles).
@@ -210,15 +210,15 @@ As of 2025, only **Ansis**, **Chalk**, and **Picocolors** are actively maintaine
210210
- ✅ Ansis: `ESM` and `CJS`
211211
- ☑️ Picocolors: `CJS` only
212212
- ☑️ Chalk: `ESM` only
213-
- Does it matter if a library performs [~60 million](#bench-simple) or [~100 million](#bench-simple) **ops/sec** when outputting to the terminal?
214-
Spoiler: All libraries are more than [fast enough](#bench-picocolors-complex).
215-
- ✅ Picocolors
216-
- ☑️ Ansis
217-
- ☑️ Chalk
218213
- Does it matter the unpacked size?
219214
-[Ansis - 6.7 kB][npm-ansis]
220215
-[Picocolors - 6.4 kB][npm-picocolors]
221216
-[Chalk - 44.4 kB][npm-chalk]
217+
- Does it matter if a library performs [~60 million](#bench-simple) or [~100 million](#bench-simple) **ops/sec** when outputting to the terminal?
218+
Spoiler: All libraries are more than [fast enough](#bench-picocolors-complex).
219+
- ✅ Picocolors
220+
- ✅ Ansis
221+
- ✅ Chalk
222222
- Does support for [ANSI 256 colors](#256-colors) or [Truecolor](#truecolor) with [fallback](#fallback) matter?
223223
- ✅ Ansis
224224
- ✅ Chalk
@@ -362,26 +362,26 @@ italic.bold.yellow.bgMagentaBright`text`;
362362

363363
## ANSI 16 colors
364364

365-
| Standard Colors | Bright Colors | Standard Backgrounds | Bright Backgrounds |
366-
|:-----------------|:----------------|:---------------------|:-------------------|
367-
| `black` | `gray` | `bgBlack` | `bgGray` |
368-
| `red` | `redBright` | `bgRed` | `bgRedBright` |
369-
| `green` | `greenBright` | `bgGreen` | `bgGreenBright` |
370-
| `yellow` | `yellowBright` | `bgYellow` | `bgYellowBright` |
371-
| `blue` | `blueBright` | `bgBlue` | `bgBlueBright` |
372-
| `magenta` | `magentaBright` | `bgMagenta` | `bgMagentaBright` |
373-
| `cyan` | `cyanBright` | `bgCyan` | `bgCyanBright` |
374-
| `white` | `whiteBright` | `bgWhite` | `bgWhiteBright` |
365+
There are 16 basic colors: 8 standard and 8 bright variants.
366+
367+
| Example | Color | Background | Bright Example | Bright Color | Bright Background |
368+
|:---------------------------------:|:---------------|:--------------------|:---------------------------------------:|:----------------|:------------------|
369+
| ![](docs/img/colors/black.png) | `black` | `bgBlack` | ![](docs/img/colors/gray.png) | `gray` | `bgGray` |
370+
| ![](docs/img/colors/red.png) | `red` | `bgRed` | ![](docs/img/colors/redBright.png) | `redBright` | `bgRedBright` |
371+
| ![](docs/img/colors/green.png) | `green` | `bgGreen` | ![](docs/img/colors/greenBright.png) | `greenBright` | `bgGreenBright` |
372+
| ![](docs/img/colors/yellow.png) | `yellow` | `bgYellow` | ![](docs/img/colors/yellowBright.png) | `yellowBright` | `bgYellowBright` |
373+
| ![](docs/img/colors/blue.png) | `blue` | `bgBlue` | ![](docs/img/colors/blueBright.png) | `blueBright` | `bgBlueBright` |
374+
| ![](docs/img/colors/magenta.png) | `magenta` | `bgMagenta` | ![](docs/img/colors/magentaBright.png) | `magentaBright` | `bgMagentaBright` |
375+
| ![](docs/img/colors/cyan.png) | `cyan` | `bgCyan` | ![](docs/img/colors/cyanBright.png) | `cyanBright` | `bgCyanBright` |
376+
| ![](docs/img/colors/white.png) | `white` | `bgWhite` | ![](docs/img/colors/whiteBright.png) | `whiteBright` | `bgWhiteBright` |
375377

376-
> [!CAUTION]
377-
> The redundant `grey`, `bgGrey`, `blackBright` and `bgBlackBright` aliases for `gray` and `bgGray` are **deprecated**.
378378

379379
<a name="gray-naming-in-libs"></a>
380380
### Color naming in libraries: `gray` vs `grey` vs `blackBright`
381381

382-
The same ANSI codes `90` (_gray_) and `100` (_bgGray_) are referred to by different names and aliases in various libraries.
382+
The same ANSI codes `90` (_gray_) and `100` (_bgGray_) are named differently in various libraries.
383383

384-
| Library | Standard<br>`gray`<br>`bgGray` | UK-spelling<br>`grey`<br>`bgGrey` | Spec-style<br>&nbsp;`blackBright`<br>`bgBlackBright` |
384+
| Library | Standard<br>`gray`<br>`bgGray` | UK spelling<br>`grey`<br>`bgGrey` | Spec-style<br>&nbsp;`blackBright`<br>`bgBlackBright` |
385385
|:---------------------------|:------------------------------:|:---------------------------------:|:----------------------------------------------------:|
386386
| [ansis][ansis] ||||
387387
| [yoctocolors][yoctocolors] ||||

docs/img/colors/black.png

110 Bytes
Loading

docs/img/colors/blue.png

83 Bytes
Loading

docs/img/colors/blueBright.png

83 Bytes
Loading

docs/img/colors/cyan.png

83 Bytes
Loading

docs/img/colors/cyanBright.png

83 Bytes
Loading

docs/img/colors/gray.png

83 Bytes
Loading

docs/img/colors/green.png

83 Bytes
Loading

docs/img/colors/greenBright.png

83 Bytes
Loading

docs/img/colors/magenta.png

83 Bytes
Loading

docs/img/colors/magentaBright.png

83 Bytes
Loading

docs/img/colors/red.png

83 Bytes
Loading

docs/img/colors/redBright.png

83 Bytes
Loading

docs/img/colors/white.png

83 Bytes
Loading

docs/img/colors/whiteBright.png

83 Bytes
Loading

docs/img/colors/yellow.png

83 Bytes
Loading

docs/img/colors/yellowBright.png

83 Bytes
Loading

0 commit comments

Comments
 (0)