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
-[Extend](#extend-colors)base colors with [**named truecolor**](https://drafts.csswg.org/css-color/#named-colors) via `ansis.extend()`, then use colors by name, e.g. `ansis.pink()`
41
+
-[ANSI 256 colors](#256-colors) via methods: `fg(num)`, `bg(num)`
-[Named truecolor](#extend-colors)(extendable with colors such as [pink, indigo, navy, ...](https://drafts.csswg.org/css-color/#named-colors)): `ansis.pink()`, `ansis.bgPink()`, ...
-Enables reliable[CLI testing](#cli-testing) with forced [color levels](#color-levels): no color, 16, 256 or Truecolor
50
-
-Replacement for [`chalk`](#replacing-chalk)[`ansi-colors`](#replacing-ansi-colors)[`colorette`](#replacing-colorette)[`picocolors`](#replacing-picocolors) and others [alternatives](#alternatives)
49
+
-Reliable[CLI testing](#cli-testing) with forced [color levels](#color-levels): no color, 16, 256 or Truecolor
50
+
-Drop-in replacement for [`chalk`](#replacing-chalk)[`ansi-colors`](#replacing-ansi-colors)[`colorette`](#replacing-colorette)[`picocolors`](#replacing-picocolors) and others [alternatives](#alternatives)
51
51
52
52
53
53
> 🚀 **You might also like**[`flaget`](https://github.com/webdiscus/flaget) - a smaller (5 kB) and faster alternative to [`yargs-parser`](https://www.npmjs.com/package/yargs-parser) (85 kB) for CLI argument parsing.
@@ -519,7 +519,7 @@ If you use the `hex()`, `rgb()` or `ansis256()` functions in a terminal not supp
519
519
## Named truecolor
520
520
521
521
Ansis supports full 24-bit color via `ansis.rgb(r, g, b)` and `ansis.hex('#rrggbb')`.\
522
-
If you prefer [**named colors**](http://dev.w3.org/csswg/css-color/#named-colors) (e.g. `beige`, `orange`, `pink`, `royalblue`, etc.)
522
+
If you prefer [**named colors**](http://dev.w3.org/csswg/css-color/#named-colors) (e.g. `pink`, `orange`, `indigo`, etc.)
523
523
instead of writing hex or RGB values by hand, resolve color names in your app and register them as extended styles on an Ansis instance via `ansis.extend()`.
524
524
Then you can call e.g., `color.pink()` or `color.bgPink()` rather than using `ansis.hex('#ffc0cb')` or `ansis.bgHex('#ffc0cb')` directly.
console.log(color.bgPink('Pink background')); // auto-generated from "pink"
549
549
```
550
550
551
-
Of course, you can define a custom subset with only the names you actually use.
551
+
Of course, you can define a custom subset with only the colors you actually use.
552
552
553
553
> [!TIP]
554
554
> Need help picking a color name? Try the [Name that Color](https://chir.ag/projects/name-that-color/#FF681F) tool - paste a hex and get its closest color name.
@@ -563,7 +563,7 @@ const myTheme = {
563
563
pink: '#ffc0cb',
564
564
};
565
565
566
-
// Create a new instance and extend it with only your custom names
566
+
// Create a new instance and extend it with only your colors
567
567
const ansis = new Ansis().extend(myTheme);
568
568
569
569
// You can still use base styles together with extended ones
0 commit comments