(banner m)Returns a multi-line Figlet (ascii art) string with the provided
:text option. Intended to render a "single line" banner,
consisting of multiple lines of constituent characters.
Can be optionally colorized with the :gradient option,
using a small set of pre-defined gradients:
(banner {:text "Hello", :gradient-colors [:green :blue]})
(banner {:text "Hello", :gradient-colors [:red :magenta]})
(banner {:text "Hello", :gradient-colors [:yellow :purple]})
(banner {:text "Hello", :gradient-colors [:orange :purple]})
(banner {:text "Hello", :gradient-colors [:cool :warm]})
Can be colorized solid with bling.core/bling
(bling [:red (banner {:text "Hello"})])
All the options:
:text
string?:font-weight
#{:bold "bold"}:bold, each subchar in figlet characters
will be bolded. Only applies when a gradient is set.:gradient-colors
#{[:yellow :purple] ["orange" "purple"] ["yellow" "purple"] ["red" "magenta"] [:red :magenta] ["green" "blue"] ["cool" "warm"] [:green :blue] [:cool :warm] [:orange :purple]}:gradient-direction
#{:to-right "to-left" :to-top "to-top" :to-left "to-bottom" "to-right" :to-bottom}:gradient-shift
[:int {:min 0, :max 5}]0.[:warm :cool] pair, this will shift the hue.:contrast
keyword?:medium.BLING_MOOD env var set,
it will default to :high in order to optimize contrast
for the users terminal theme (light or dark):margin-top
int?1.:margin-bottom
int?0.:margin-left
int?0.:margin-right
int?0.
Returns a multi-line Figlet (ascii art) string with the provided
`:text` option. Intended to render a "single line" banner,
consisting of multiple lines of constituent characters.
Can be optionally colorized with the `:gradient` option,
using a small set of pre-defined gradients:
```clojure
(banner {:text "Hello", :gradient-colors [:green :blue]})
(banner {:text "Hello", :gradient-colors [:red :magenta]})
(banner {:text "Hello", :gradient-colors [:yellow :purple]})
(banner {:text "Hello", :gradient-colors [:orange :purple]})
(banner {:text "Hello", :gradient-colors [:cool :warm]})
```
Can be colorized solid with `bling.core/bling`
```clojure
(bling [:red (banner {:text "Hello"})])
```
All the options:
* **`:text`**
- `string?`
- Required.
- The text to set in the banner.
* **`:font-weight`**
- `#{:bold "bold"}`
- Optional.
- If set to `:bold`, each subchar in figlet characters
will be bolded. Only applies when a gradient is set.
* **`:gradient-colors`**
- `#{[:yellow :purple] ["orange" "purple"] ["yellow" "purple"] ["red" "magenta"] [:red :magenta] ["green" "blue"] ["cool" "warm"] [:green :blue] [:cool :warm] [:orange :purple]}`
- Optional.
- Sets the beginning and end colors of the gradient.
Expects a vector of 2 keywords.
* **`:gradient-direction`**
- `#{:to-right "to-left" :to-top "to-top" :to-left "to-bottom" "to-right" :to-bottom}`
- Optional.
- Direction of the gradient.
* **`:gradient-shift`**
- `[:int {:min 0, :max 5}]`
- Optional.
- Defaults to `0`.
- If gradient is `[:warm :cool]` pair, this will shift the hue.
* **`:contrast`**
- `keyword?`
- Optional.
- Defaults to `:medium`.
- If gradient is set, this will force an overall lighter or
darker tone. If the user has a `BLING_MOOD` env var set,
it will default to `:high` in order to optimize contrast
for the users terminal theme (light or dark)
* **`:margin-top`**
- `int?`
- Optional.
- Defaults to `1`.
- Amount of margin (in newlines) at top, outside banner.
* **`:margin-bottom`**
- `int?`
- Optional.
- Defaults to `0`.
- Amount of margin (in newlines) at bottom, outside banner.
* **`:margin-left`**
- `int?`
- Optional.
- Defaults to `0`.
- Amount of margin (in blank character spaces) at left,
outside banner.
* **`:margin-right`**
- `int?`
- Optional.
- Defaults to `0`.
- Amount of margin (in blank character spaces) at right,
outside banner.cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |