https://github.com/generalsimus/colby
https://github.com/generalsimus/colby
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/generalsimus/colby
- Owner: Generalsimus
- License: mit
- Created: 2023-01-06T22:50:23.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-20T19:00:32.000Z (over 3 years ago)
- Last Synced: 2025-02-03T18:55:39.626Z (over 1 year ago)
- Language: TypeScript
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# [Colby](https://www.npmjs.com/package/colby)
#### The fastest library for ANSI colors and highlighting console logs
[![npm version][npm-version-src]][npm-version-href]
[![npm href][standard-js-src]][standard-js-href]
[standard-js-src]: https://img.shields.io/badge/license-MIT-brightgreen?&style=flat-square
[standard-js-href]: https://github.com/Generalsimus/colby/blob/master/LICENSE
[npm-version-src]: https://img.shields.io/npm/v/colby?&style=flat-square
[npm-version-href]: https://www.npmjs.com/package/colby
### RGB Color
```js
const { toRgb } = require("colby/toRgb");
console.log(toRgb(200, 1, 1)("This text is rgb(200, 1, 1) red!"));
const blueColor = toRgb(0, 0, 255);
console.log(blueColor("Background of this text is rgb(0, 0, 255) blue!", true));
```

### HEX Color
```js
const { toHex } = require("colby/toHex");
console.log(toHex("#FF0000")("This text is #FF0000 red!"));
const blueColor = toHex("#0000FF");
console.log(blueColor("Background of this text is #0000FF blue!", true));
```

### Default Colors
```js
const { color } = require("colby/color");
console.log(color.Red("This text is red"));
console.log(color.Green("This text is green"));
console.log(color.Cyan("This text is cyan"));
console.log(color.Yellow("This text is yellow"));
// text Background-color
console.log(color.Red("Background of this text is red", true));
console.log(color.Green("Background of this text is green", true));
console.log(color.Cyan("Background of this text is cyan", true));
console.log(color.Yellow("Background of this text is yellow", true));
```

### Style
```js
const { style } = require("colby/style");
console.log(style.Underlined("text with underline"));
console.log(style.Dim("Text with dim"));
console.log(style.Italic("Text with italic"));
console.log(style.Reverse("Text with reverse"));
console.log(style.StrikeThrough("Text with strike through"));
```

## License
MIT