Liking cljdoc? Tell your friends :D

bling.banner


(banner m)

Returns a multi-line Figlet (ascii art) string with the provided :text option.

Intended to render a "single line" banner.

Can be optionally colorized with the :gradient option, using a small set of pre-defined gradients:

(banner {:text "Hello" :gradient-colors [:green :blue]})

Valid :gradient-color values:

[:green :blue], [:red :magenta], [:yellow :purple], [:orange :purple], [:cool :warm]

Valid :gradient-direction values:

:to-top, :to-bottom, :to-right, :to-left

Can be colorized solid with bling.core/bling:

(bling [:red (banner {:text "Hello"})])

KeyPredDescription
:fontmap?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, or bling.fonts.isometric-1/isometric-1. Defaults to bling.fonts.ansi-shadow/ansi-shadow.
:textstring?The text to set in the banner.
:font-weightkeyword?If set to :bold, each subchar in figlet characters will be bolded. Only applies when a gradient is set.
:gradient-colorsvector?Expects a vector of 2 keywords. Only the following color pairs are valid: [:green :blue], [:red :magenta], [:yellow :purple], [:orange :purple], [:cool :warm]. Only applies to terminal emulator printing
:gradient-directionkeyword?Expects a keyword. Must be one of: :to-top, :to-bottom, :to-right, and :to-left. Only applies to terminal emulator printing
:gradient-shiftint?If gradient is [:warm :cool] pair, this will shift the hue. 0-5. Defaults to 0.
:contrastkeyword?If gradient is set, this will force an overall lighter or darker tone. Defaults to :medium. 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-topint?Amount of margin (in newlines) at top, outside banner. <br>Defaults to 1. Only applies to terminal emulator printing.
:margin-bottomint?Amount of margin (in newlines) at bottom, outside banner. <br>Defaults to 0. Only applies to terminal emulator printing.
:margin-leftint?Amount of margin (in blank character spaces) at left, outside banner. <br>Defaults to 0. Only applies to terminal emulator printing.
:margin-rightint?Amount of margin (in blank character spaces) at right, outside banner. <br>Defaults to 0. Only applies to terminal emulator printing.
Returns a multi-line Figlet (ascii art) string with the provided `:text`
   option.
   

   Intended to render a "single line" banner.


   Can be optionally colorized with the `:gradient` option, using a small set of
   pre-defined gradients:

   ```(banner {:text "Hello" :gradient-colors [:green :blue]})```
   

   Valid `:gradient-color` values: 

   `[:green :blue]`, 
   `[:red :magenta]`, 
   `[:yellow :purple]`, 
   `[:orange :purple]`, 
   `[:cool :warm]`



   Valid `:gradient-direction` values: 

   `:to-top`, 
   `:to-bottom`, 
   `:to-right`, 
   `:to-left`



   Can be colorized solid with `bling.core/bling`:

   ```(bling [:red (banner {:text "Hello"})])```

   
| Key                   | Pred       | Description   |
| :---------------      | -----------| ------------- |
| `:font`               | `map?`     | 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,` or `bling.fonts.isometric-1/isometric-1`. Defaults to `bling.fonts.ansi-shadow/ansi-shadow`. |
| `:text`               | `string?`  | The text to set in the banner.
| `:font-weight`        | `keyword?` | If set to `:bold`, each subchar in figlet characters will be bolded. Only applies when a gradient is set.
| `:gradient-colors`    | `vector?`  | Expects a vector of 2 keywords. Only the following color pairs are valid: `[:green :blue]`, `[:red :magenta]`, `[:yellow :purple]`, `[:orange :purple]`, `[:cool :warm]`.  Only applies to terminal emulator printing|
| `:gradient-direction` | `keyword?` | Expects a keyword. Must be one of: `:to-top`, `:to-bottom`, `:to-right`, and `:to-left`.  Only applies to terminal emulator printing|
| `:gradient-shift`     | `int?`     | If gradient is `[:warm :cool]` pair, this will shift the hue. `0-5`. Defaults to `0`.|
| `:contrast`           | `keyword?` | If gradient is set, this will force an overall lighter or darker tone. Defaults to `:medium`. 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?`     | Amount of margin (in newlines) at top, outside banner. <br>Defaults to `1`. Only applies to terminal emulator printing. |
| `:margin-bottom`      | `int?`     | Amount of margin (in newlines) at bottom, outside banner. <br>Defaults to `0`. Only applies to terminal emulator printing. |
| `:margin-left`        | `int?`     | Amount of margin (in blank character spaces) at left, outside banner. <br>Defaults to `0`. Only applies to terminal emulator printing. |
| `:margin-right`       | `int?`     | Amount of margin (in blank character spaces) at right, outside banner. <br>Defaults to `0`. Only applies to terminal emulator printing. |
sourceraw docstring

banner*clj/s

(banner* {:keys [text letter-spacing font-weight gradient-direction
                 gradient-colors gradient-shift contrast :dev/print-font!
                 display-missing-chars?]
          :as opts
          :or {display-missing-chars? true
               letter-spacing 0
               gradient-colors nil
               gradient-shift 0
               gradient-direction :to-bottom
               font-weight :normal}
          user-font :font})
source

(banner-str-chars font-map char-height text display-missing-chars?)
source

caught-exception!clj/s

source

gradient-colors-setclj/s

source

gradient-directionsclj/s

source

gradient-mapclj/s

(gradient-map gradient-colors direction gradient-shift contrast)

Expects a string as first argument representing a linear-gradient in standard css syntax: "to bottom, yellow, purple"

Expects a map (banner opts) as second argument, from which a value for the :contrast option may be provided.

If the user has BLING_MOOD env var set, the darker or lighter variant of the base color will be used, depending on the value of BLING_MOOD, which corresponds to the background terminal. The purpose is to lower or heighten the contrast.

Returns a map: {:gradient-range '(40 41 42 43 44 45) ;; <- range of sgr codes :gradient-orientation :vertical :vertical-gradient? true :horizontal-gradient? false }

Expects a string as first argument representing a linear-gradient in standard
css syntax:
"to bottom, yellow, purple"

Expects a map (banner opts) as second argument, from which a value for the
:contrast option may be provided.

If the user has BLING_MOOD env var set, the darker or lighter variant of the
base color will be used, depending on the value of BLING_MOOD, which
corresponds to the background terminal. The purpose is to lower or heighten
the contrast.

Returns a map:
{:gradient-range       '(40 41 42 43 44 45) ;; <- range of sgr codes
 :gradient-orientation :vertical
 :vertical-gradient?   true
 :horizontal-gradient? false
}
sourceraw docstring

gradient-pairs-all-base-colors-setclj/s

source

gradient-pairs-as-keywords-setclj/s

source

gradient-pairs-cool-warm-mapclj/s

source

gradient-pairs-mapclj/s

source

gradient-pairs-setclj/s

source

gradient-pointsclj/s

source

gradient-points-cool-warmclj/s

source

gradient-rangesclj/s

source

gradient-ranges-cool-warmclj/s

source

horizontal-gradientclj/s

(horizontal-gradient composed gr opts)
source

invalid-gradient-opt-warning!clj/s

(invalid-gradient-opt-warning! {:keys [gradient gradient-pairs-map
                                       show-examples?]})
source

resolve-base-gradient-color-for-themeclj/s

(resolve-base-gradient-color-for-theme contrast color-str)
source

shade-namesclj/s

source

shift-maxclj/s

source

shift-minclj/s

source

zero-or-pos-int?clj/s

(zero-or-pos-int? n)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close