summaryrefslogtreecommitdiff
path: root/std/fmt/colors.ts
diff options
context:
space:
mode:
Diffstat (limited to 'std/fmt/colors.ts')
-rw-r--r--std/fmt/colors.ts20
1 files changed, 13 insertions, 7 deletions
diff --git a/std/fmt/colors.ts b/std/fmt/colors.ts
index a020657d9..7a12b2883 100644
--- a/std/fmt/colors.ts
+++ b/std/fmt/colors.ts
@@ -186,7 +186,10 @@ export function rgb24(str: string, color: number | Rgb): string {
if (typeof color === "number") {
return run(
str,
- code([38, 2, (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff], 39)
+ code(
+ [38, 2, (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff],
+ 39,
+ ),
);
}
return run(
@@ -199,8 +202,8 @@ export function rgb24(str: string, color: number | Rgb): string {
clampAndTruncate(color.g),
clampAndTruncate(color.b),
],
- 39
- )
+ 39,
+ ),
);
}
@@ -217,7 +220,10 @@ export function bgRgb24(str: string, color: number | Rgb): string {
if (typeof color === "number") {
return run(
str,
- code([48, 2, (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff], 49)
+ code(
+ [48, 2, (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff],
+ 49,
+ ),
);
}
return run(
@@ -230,8 +236,8 @@ export function bgRgb24(str: string, color: number | Rgb): string {
clampAndTruncate(color.g),
clampAndTruncate(color.b),
],
- 49
- )
+ 49,
+ ),
);
}
@@ -241,7 +247,7 @@ const ANSI_PATTERN = new RegExp(
"[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
"(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))",
].join("|"),
- "g"
+ "g",
);
export function stripColor(string: string): string {