DEFAULT_BACKGROUND

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

Definition

const DEFAULT_BACKGROUND = "\x1b[49m";

Description

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

Usage

import { BackgroundColors, DEFAULT_BACKGROUND } from "ts-better-console";

// Resets only background — foreground/intensity untouched
console.log(BackgroundColors.blue + "Text on blue background" + DEFAULT_BACKGROUND);
console.log("Back to default background");

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!