diff options
| author | David Sherret <dsherret@users.noreply.github.com> | 2020-07-14 15:24:17 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-14 15:24:17 -0400 |
| commit | cde4dbb35132848ffece59ef9cfaccff32347124 (patch) | |
| tree | cc7830968c6decde704c8cfb83c9185193dc698f /std/fmt/colors.ts | |
| parent | 9eca71caa1674c31f9cc5d4e86c03f10b59e0a00 (diff) | |
Use dprint for internal formatting (#6682)
Diffstat (limited to 'std/fmt/colors.ts')
| -rw-r--r-- | std/fmt/colors.ts | 20 |
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 { |
