raptor-colors
v1.0.1
Published
A TypeScript library for IRC-style text coloring
Maintainers
Readme
Raptor Colors 🐡
A TypeScript library for adding IRC-style colors to text strings.
Installation
npm install raptor-colors
# or
yarn add raptor-colorsUsage
import rc from 'raptor-colors';
// Basic usage
console.log(rc.red('This text is red'));
console.log(rc.blue('This text is blue'));
console.log(rc.green('This text is green'));
// With custom background color
console.log(rc.withBackground('white').red('Red text on white background'));Available Colors
- white
- black
- blue
- green
- red
- brown
- purple
- orange
- yellow
- lightGreen
- cyan
- lightCyan
- lightBlue
- pink
- grey
- lightGrey
Methods
Basic Color Methods
Each color is available as a direct method:
c.red(text: string): string
c.blue(text: string): string
// ... etc for all colorsCustom Background Colors
Use the withBackground method to set a custom background color:
c.withBackground(bgColor: ColorName).[color](text: string)License
MIT
