terminal-styling
Version:
A npm package to add some styling to terminal output
45 lines (44 loc) • 1.03 kB
TypeScript
/**
* Color utility using hex codes for terminal ANSI escape sequences
*
* @export
* @class Colors
* @typedef {Colors}
*/
export declare class Colors {
/**
* Converts a hex color string to an RGB tuple
*
* @private
* @param {string} hex
* @returns {[number, number, number]}
*/
private hexToRgb;
/**
* Generates a foreground color ANSI escape sequence from hex
*
* @param {string} hex
* @returns {string}
*/
foregroundColor: (hex: string) => string;
/**
* Generates a background color ANSI escape sequence from hex
*
* @param {string} hex
* @returns {string}
*/
backgroundColor: (hex: string) => string;
/**
* Resets all ANSI styles
*
* @returns {string}
*/
reset: () => string;
/**
* Checks if the terminal supports true color
*
* @returns {boolean}
*/
supportsTrueColor(): boolean;
}
export declare const color: Colors;