Home

ForTheBadge

This is a very simple package, which will generate a badge in the style of ForTheBadge.

ForTheBadge.badgeFunction.
badge(
    labels; # must be the same length as kwargs, so if you
    fonts = ("Roboto Medium", "Montserrat ExtraBold")
    bgcolours = (colorant"#a7bfc1", colorant"#5593c8"),
    textcolours = (colorant"white", colorant"white"),
    padding = 13,
    h = 50,
    ext = :pdf,
    filename = join(labels, "_") * ".$ext",
    textsize = 20,
    texttype = :path,
    showbadge = true
)

badge(labels...; kwargs...)

Provided labels, font sizes and colours of the appropriate type, this function will create a badge in the style of (ForTheBadge)[https://forthebadge.com/].

Input must be in the form of tuples.

Keyword arguments

* `texttype` may be `:path` or `:text`.
* `ext` may be `:pdf`, `:png`, or `:svg`.
* `showbadge` controls whether the badge is opened
  by the system viewer after it is drawn.

Examples:

# To generate the logo:
badge(
    "FOR", "THE", "BADGE", ".jl";
    filename = "logo.svg",
    textcolours = (colorant"white", colorant"white", colorant"white", colorant"white"),
    bgcolours = (julia_green, julia_purple, julia_red, julia_blue),
    fonts = ("Roboto Medium", "Roboto Medium", "Montserrat ExtraBold", "Roboto Medium")
)
source

Note that output SVGs have text drawn as a path by default, not as text; this is to ensure maximum portability.

Examples

badge("USING", "MAKIE")