Liking cljdoc? Tell your friends :D
All platforms.

bling.banner


(banner m)

Returns a Figlet (ascii art) banner with the provided :text option.

Intended to render a "single line" banner, or multiple lines of constituent characters.

Can be optionally colorized with the :gradient option, using a 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 you need:

  • :font

    • map?
    • Optional.
    • Defaults to bling.fonts.ansi-shadow/ansi-shadow.
    • Must be one of the fonts that ships with Bling:
      • bling.fonts.ansi-shadow/ansi-shadow
      • bling.fonts.big-money.big-money/big-money
      • bling.fonts.big/big
      • bling.fonts.miniwi/miniwi
      • bling.fonts.drippy/drippy
      • bling.fonts.isometric-1/isometric-1
  • :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"] ["cool" "warm"] ["green" "blue"] [:red :magenta] ["yellow" "purple"] ["red" "magenta"] [: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-top "to-bottom" "to-right" "to-top" "to-left" :to-left :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.
Returns a Figlet (ascii art) banner with the provided `:text` option.

Intended to render a "single line" banner, or multiple lines of constituent
characters.

Can be optionally colorized with the `:gradient` option, using a 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 you need:

* **`:font`**
    - `map?`
    - Optional.
    - Defaults to `bling.fonts.ansi-shadow/ansi-shadow`.
    - Must be one of the fonts that ships with Bling:
        - bling.fonts.ansi-shadow/ansi-shadow
        - bling.fonts.big-money.big-money/big-money
        - bling.fonts.big/big
        - bling.fonts.miniwi/miniwi
        - bling.fonts.drippy/drippy
        - bling.fonts.isometric-1/isometric-1

* **`: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"] ["cool" "warm"] ["green" "blue"] [:red :magenta] ["yellow" "purple"] ["red" "magenta"] [: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-top "to-bottom" "to-right" "to-top" "to-left" :to-left :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.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close