Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rgb() and bgRgb() #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions colors.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export declare const cyan: Colorize;
export declare const white: Colorize;
export declare const gray: Colorize;
export declare const grey: Colorize;
export declare const rgb: (r: number, g: number, b: number) => Colorize;

// Backgrounds
export declare const bgBlack: Colorize;
Expand All @@ -26,6 +27,7 @@ export declare const bgBlue: Colorize;
export declare const bgMagenta: Colorize;
export declare const bgCyan: Colorize;
export declare const bgWhite: Colorize;
export declare const bgRgb: (r: number, g: number, b: number) => Colorize;

// Modifiers
export declare const reset: Colorize;
Expand Down
2 changes: 2 additions & 0 deletions colors.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const cyan = init(36, 39);
export const white = init(37, 39);
export const gray = init(90, 39);
export const grey = init(90, 39);
export const rgb = (r, g, b) => init(`38;2;${r};${g};${b}`, 39);

// background colors
export const bgBlack = init(40, 49);
Expand All @@ -51,3 +52,4 @@ export const bgBlue = init(44, 49);
export const bgMagenta = init(45, 49);
export const bgCyan = init(46, 49);
export const bgWhite = init(47, 49);
export const bgRgb = (r, g, b) => init(`48;2;${r};${g};${b}`, 49);