DEFAULT_COLOR

DEFAULT_COLOR is the ANSI escape code that resets only the foreground (text) color to the terminal's default, leaving background color and intensity attributes untouched.

Definition

const DEFAULT_COLOR = "\x1b[39m";

Description

The value "\x1b[39m" is SGR parameter 39 — "default foreground color". It restores the terminal's default foreground color without resetting the background, bold, or any other attribute. Use it instead of \x1b[0m when you only want to cancel a color applied by Colors or a custom getColorCode call.

Usage

import { Colors, DEFAULT_COLOR } from "ts-better-console";

// Resets only foreground — background/intensity untouched
console.log(Colors.red + "Red text" + DEFAULT_COLOR);
console.log("This is back to default color");

Want to support this project?

If you find ts-better-console useful and want to support its development, consider starring the GitHub repository or buying me a coffee! Your support helps me dedicate more time to improving the library and adding new features.

Want to contribute to this project?

Contributions are welcome! If you're interested in improving the library, fixing bugs, or adding new features, feel free to check out the GitHub repository and submit a pull request. Whether you're a seasoned developer or new to open source, your contributions can make a difference!