transform
Text transformation library for generating colored console output
Status
Stable: Functionality is covered by semantic versioning guarantees and unlikely to see breaking changes
Availability
This module is preloaded. You can simply require
it:
local transform = require("transform")
Functions
black
Returns the input string wrapped in ANSI escape sequences so that it is rendered black in supporting terminals.
Available since: v0.0.1Arguments |
---|
# | Name | Type | Fallback |
---|
| text | string | |
Return values |
---|
# | Name | Type |
---|
| coloredText | string |
blackBackground
Returns the input string wrapped in ANSI escape sequences so that it is rendered on a black background in supporting terminals.
Available since: v0.0.1Arguments |
---|
# | Name | Type | Fallback |
---|
| text | string | |
Return values |
---|
# | Name | Type |
---|
| coloredText | string |
bold
Returns the input string wrapped in ANSI escape sequences so that it is rendered with bold font in supporting terminals.
Available since: v0.0.1Arguments |
---|
# | Name | Type | Fallback |
---|
| text | string | |
Return values |
---|
# | Name | Type |
---|
| transformedText | string |
brightRed
Returns the input string wrapped in ANSI escape sequences so that it is rendered bright red in supporting terminals.
Available since: v0.0.1Arguments |
---|
# | Name | Type | Fallback |
---|
| text | string | |
Return values |
---|
# | Name | Type |
---|
| coloredText | string |
brightRedBackground
Returns the input string wrapped in ANSI escape sequences so that it is rendered on a bright red background in supporting terminals.
Available since: v0.0.1Arguments |
---|
# | Name | Type | Fallback |
---|
| text | string | |
Return values |
---|
# | Name | Type |
---|
| coloredText | string |
cyan
Returns the input string wrapped in ANSI escape sequences so that it is rendered cyan in supporting terminals.
Available since: v0.0.1Arguments |
---|
# | Name | Type | Fallback |
---|
| text | string | |
Return values |
---|
# | Name | Type |
---|
| coloredText | string |
enable
Globally enables text transformations. This operation is not applied retroactively. Text transformations are enabled by default.
disable
Globally disables text transformations. This operation is not applied retroactively. Use this if your terminal can't display colors.
gray
Returns the input string wrapped in ANSI escape sequences so that it is rendered gray in supporting terminals.
Available since: v0.0.1Arguments |
---|
# | Name | Type | Fallback |
---|
| text | string | |
Return values |
---|
# | Name | Type |
---|
| coloredText | string |
green
Returns the input string wrapped in ANSI escape sequences so that it is rendered green in supporting terminals.
Available since: v0.0.1Arguments |
---|
# | Name | Type | Fallback |
---|
| text | string | |
Return values |
---|
# | Name | Type |
---|
| coloredText | string |
greenBackground
Returns the input string wrapped in ANSI escape sequences so that it is rendered on a green background in supporting terminals.
Available since: v0.0.1Arguments |
---|
# | Name | Type | Fallback |
---|
| text | string | |
Return values |
---|
# | Name | Type |
---|
| coloredText | string |
red
Returns the input string wrapped in ANSI escape sequences so that it is rendered dark red in supporting terminals.
Available since: v0.0.1Arguments |
---|
# | Name | Type | Fallback |
---|
| text | string | |
Return values |
---|
# | Name | Type |
---|
| coloredText | string |
underline
Returns the input string wrapped in ANSI escape sequences so that it is rendered underlined in supporting terminals.
Available since: v0.0.1Arguments |
---|
# | Name | Type | Fallback |
---|
| text | string | |
Return values |
---|
# | Name | Type |
---|
| transformedText | string |
yellow
Returns the input string wrapped in ANSI escape sequences so that it is rendered yellow in supporting terminals.
Available since: v0.0.1Arguments |
---|
# | Name | Type | Fallback |
---|
| text | string | |
Return values |
---|
# | Name | Type |
---|
| coloredText | string |
white
Returns the input string wrapped in ANSI escape sequences so that it is rendered white in supporting terminals.
Available since: v0.0.1Arguments |
---|
# | Name | Type | Fallback |
---|
| text | string | |
Return values |
---|
# | Name | Type |
---|
| coloredText | string |
whiteBackground
Returns the input string wrapped in ANSI escape sequences so that it is rendered on a white background in supporting terminals.
Available since: v0.0.1Arguments |
---|
# | Name | Type | Fallback |
---|
| text | string | |
Return values |
---|
# | Name | Type |
---|
| coloredText | string |
Changelog
Version | What happened? |
---|
v0.0.1 | Initial release |