Skip to content

Commit

Permalink
docs: update true colors
Browse files Browse the repository at this point in the history
  • Loading branch information
xinyao27 committed May 17, 2024
1 parent 202a678 commit 98b9a5c
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,27 @@ _This package supports [basic color detection](https://nodejs.org/api/tty.html#w
- `bgCyanBright`
- `bgWhiteBright`

### TrueColor

You can use the `hex` or `rgb` format.

Foreground function: `hex()` `rgb()`
Background function: `bgHex()` `bgRgb()`

```ts
import { bgHex, bgRgb, hex, rgb } from 'xycolors'

// foreground color
hex('#E0115F')('Ruby')
hex('#96C')('Amethyst')
rgb(224, 17, 95)('Ruby')

// background color
bgHex('#E0115F')('Ruby')
bgHex('#96C')('Amethyst')
bgRgb(224, 17, 95)('Ruby')
```

## Benchmark

```sh
Expand Down

0 comments on commit 98b9a5c

Please sign in to comment.