Installation
Install hexmakR from CRAN:
install.packages("hexmakR")Or install the development version from GitHub:
# install.packages("pak")
pak::pak("r-heller/hexmakR")Your first hex sticker in 3 lines
library(hexmakR)
hex_sticker("mypackage", icon = "atom", theme = "stats")That’s it. The default settings produce a dark-themed sticker with
the stats color palette and an atom icon.
Saving to a file
Pass filename to write a transparent PNG directly:
hex_sticker(
"mypackage",
icon = "dna",
theme = "genomics",
filename = "man/figures/logo.png"
)The file will have the correct hexb.in aspect ratio (width / height = √3 / 2) and a transparent background, ready for use in your README or pkgdown site.
Exploring themes
Preview a theme interactively:
hexmakr_preview_theme("genomics", mode = "dark")
hexmakr_preview_theme("genomics", mode = "light")Exploring icons
# All categories
names(hexmakr_icons())
# Icons in a specific category
hexmakr_icons("biology")Customizing colors
Override any theme color individually:
hex_sticker(
"mypackage",
theme = "stats",
mode = "dark",
bg = "#0D1117",
accent = "#58A6FF",
text_color = "#FFFFFF",
border_color = "#58A6FF",
sub_color = "#8B949E"
)Choosing a font
hex_sticker(
"mypackage",
font_family = "serif",
font_bold = TRUE,
font_italic = TRUE,
font_size = 14
)Available font shorthands: "mono",
"courier", "consolas",
"source_code", "fira_code",
"serif", "times", "palatino",
"sans", "helvetica", "roboto",
"open_sans", "lato".
Next steps
- For full parameter reference:
vignette("programmatic-usage") - To use the interactive designer:
vignette("shiny-app")or just runhexmakr_app()