tools/logo.R

()
() + ggplot2::theme_bw() + erase(axis.title, axis.ticks, title)

("heavywatal.svg")
("heavywatal.png") |> oxipng()
("heavywatal-white.png") |> oxipng()
("heavywatal-circle.png") |> oxipng()
("heavywatal-circle-white.png") |> oxipng()
save_sticker("heavywatal-hex.png") |>
  oxipng() |>
  fs::file_copy("../man/figures/logo.png", overwrite = TRUE)
save_sticker("heavywatal-hex.svg") |>
  fs::file_copy("../man/figures/logo.svg", overwrite = TRUE)

"heavywatal-tohoku_ac_jp-circle-white.png" |>
  (swoosh = "#3e1686", dot = "#3e1686") |>
  oxipng()

fs::dir_create("web")
("web/favicon.svg")
("web/favicon.png", 1, 32) |> oxipng()
("web/icon-192.png", 1, 192) |> oxipng()
("web/icon-512.png", 1, 512) |> oxipng()
("web/apple-touch-icon.png", 1, 180, bg = "#ffffff") |> oxipng()

ukraine_layers = function(x = c(-Inf, 0.5), y = 0.5) {
  list(
    geom_ribbon(aes(x = x, y = NULL, ymin = y, ymax = Inf), fill = "#0057b7"),
    geom_ribbon(aes(x = x, y = NULL, ymin = -Inf, ymax = y), fill = "#ffd700")
  )
}

mg = c(
  ukraine_layers(),
  wtl::annotate_regpolygon(180L, radius = 0.60, x = 0.5, y = 0.5, alpha = 0.66, fill = "#ffffff")
)
("heavywatal-ua-circle-white.png", midground = mg) |> oxipng()
("heavywatal-ua-white.png", midground = ukraine_layers()) |> oxipng()

fs::dir_create("test")
c(1, 2, 4, 6, 12) |> purrr::walk(\(height) {
  (wtl::glue("test/png-heavywatal-white-{height}.png"), height, dpi = 1200 / height)
  (wtl::glue("test/svg-heavywatal-white-{height}.svg"), height)
})
heavywatal/rwtl documentation built on April 29, 2024, 2:02 a.m.