Created
June 10, 2025 18:21
-
-
Save dbetebenner/25054393cd6b00c131ffc2b82f162ad3 to your computer and use it in GitHub Desktop.
Create hexsticker for packageSkeleton
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
####################################################################### | |
### Script to create sticker for packageSkeleton | |
####################################################################### | |
# Load necessary libraries | |
library(hexSticker) | |
library(magick) | |
# Create sticker | |
sticker("assets/packageSkeleton_ORIGINAL.png", package="packageSkeleton", | |
h_size = 1.25, h_color = "orange", | |
p_color = "orange", p_size = 12, p_x = 1.0, p_y = 0.29, | |
url = "https://centerforassessment.github.io/packageSkeleton/", | |
u_x = 0.245, u_y = 1.455, u_size = 5, u_angle = 30, u_color = "black", | |
s_x = 1.0, s_y = 1.0, s_width = 1.135, s_height = 1.135, dpi = 600, | |
white_around_sticker = TRUE, | |
filename = "assets/packageSkeleton_TEMP.png") | |
fuzz <- 50 | |
p <- image_read("assets/packageSkeleton_TEMP.png") | |
pp <- p %>% | |
image_fill(color = "transparent", refcolor = "white", fuzz = fuzz, point = "+1+1") %>% | |
image_fill(color = "transparent", refcolor = "white", fuzz = fuzz, point = paste0("+", image_info(p)$width-1, "+1")) %>% | |
image_fill(color = "transparent", refcolor = "white", fuzz = fuzz, point = paste0("+1", "+", image_info(p)$height-1)) %>% | |
image_fill(color = "transparent", refcolor = "white", fuzz = fuzz, point = paste0("+", image_info(p)$width-1, "+", image_info(p)$height-1)) | |
image_write(image = pp, path = "assets/packageSkeleton.png") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment