forked from rebolsource/r3
-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FEAT: Add missing docstrings and optimize with
ajoin
- Loading branch information
Showing
1 changed file
with
10 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,16 @@ | ||
Rebol [ | ||
Title: "ANSI escape sequences support" | ||
File: %mezz-ansi.reb | ||
Version: 1.0.0 | ||
Date: 4-Mar-2021 | ||
Version: 1.1.0 | ||
Date: 9-Mar-2025 | ||
Purpose: "Decorate any value with bright ANSI color sequences" | ||
] | ||
|
||
;- using 2x append to avoid making a reduced block for the output | ||
as-gray: func[value][append append copy "^[[1;30m" value "^[[0m"] | ||
as-red: func[value][append append copy "^[[1;31m" value "^[[0m"] | ||
as-green: func[value][append append copy "^[[1;32m" value "^[[0m"] | ||
as-yellow: func[value][append append copy "^[[1;33m" value "^[[0m"] | ||
as-blue: func[value][append append copy "^[[1;34m" value "^[[0m"] | ||
as-purple: func[value][append append copy "^[[1;35m" value "^[[0m"] | ||
as-cyan: func[value][append append copy "^[[1;36m" value "^[[0m"] | ||
as-white: func[value][append append copy "^[[1;37m" value "^[[0m"] | ||
as-gray: func["Decorates a value with gray ANSI escape codes" value return: [string!]][ajoin ["^[[1;30m" value "^[[0m"]] | ||
as-red: func["Decorates a value with red ANSI escape codes" value return: [string!]][ajoin ["^[[1;31m" value "^[[0m"]] | ||
as-green: func["Decorates a value with green ANSI escape codes" value return: [string!]][ajoin ["^[[1;32m" value "^[[0m"]] | ||
as-yellow: func["Decorates a value with yellow ANSI escape codes" value return: [string!]][ajoin ["^[[1;33m" value "^[[0m"]] | ||
as-blue: func["Decorates a value with blue ANSI escape codes" value return: [string!]][ajoin ["^[[1;34m" value "^[[0m"]] | ||
as-purple: func["Decorates a value with purple ANSI escape codes" value return: [string!]][ajoin ["^[[1;35m" value "^[[0m"]] | ||
as-cyan: func["Decorates a value with cyan ANSI escape codes" value return: [string!]][ajoin ["^[[1;36m" value "^[[0m"]] | ||
as-white: func["Decorates a value with white ANSI escape codes" value return: [string!]][ajoin ["^[[1;37m" value "^[[0m"]] |