forwards / tasks

Repository to keep tabs on all Forwards tasks
6 stars 1 forks source link

Hex stickers? #3

Closed maelle closed 6 years ago

maelle commented 6 years ago

Print and give out at conferences? Would need a budget.

R-Ladies step by step https://github.com/rladies/starter-kit/tree/master/stickers

hturner commented 6 years ago

Even without a budget we could contribute to the wall of stickers at useR! 2018: https://twitter.com/useR2018_conf/status/999443177412030464

@dicook do you know if there's a deadline for this?

dicook commented 6 years ago

Just as soon as possible so we can get the banner printed in time for useR! 2018.

On May 27, 2018, at 6:48 PM, Heather Turner notifications@github.com wrote:

Even without a budget we could contribute to the wall of stickers at useR! 2018: https://twitter.com/useR2018_conf/status/999443177412030464

@dicook do you know if there's a deadline for this?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.


Di Cook visnut@gmail.com

maelle commented 6 years ago
# make hex sticker
library("magrittr")
logo_path <- "https://github.com/forwards/website_source/raw/master/static/images/forwards.png"
# first step, hex sticker with wrong border
hexSticker::sticker(logo_path, package="",
        filename="temp.png",
        h_fill = "white",
        h_color = "green",
        s_width = 0.7, 
        s_height = 0.7,
        h_size = 2,
        s_x = 1, s_y = 1)

# now make border transparent
height <- magick::image_info(magick::image_read("temp.png"))$height
width <- magick::image_info(magick::image_read("temp.png"))$width
img <- magick::image_blank(width, height, "white") %>%
  magick::image_composite(magick::image_read("temp.png")) %>%
  magick::image_transparent(color = "#00FF00", fuzz = 1) 

# blank gradient image for the background
fig <- magick::image_graph(width = width, height = height, res = 96)
x <- y <- seq(0,1,length.out=100)
tmp <- expand.grid(x=x,y=y)
z <- matrix( tmp$y , 100 )
par(mar=rep(0, 4), xpd = NA)
image(x, y, z, col = viridis::viridis_pal(option = "magma")(100),
      axes = FALSE, xlab = "", ylab = "")
dev.off()

magick::image_composite(fig, img) %>%
  magick::image_transparent("white") %>%
  magick::image_write("forwards_hex.png")

Where should this piece of code live @hturner?

maelle commented 6 years ago

Edited (and code updated) to make background transparent:

forwards_hex

maelle commented 6 years ago

And with a dark border as suggested by @hturner


hexSticker::sticker(logo_path, package="",
                    filename="forwards_hex2.png",
                    h_fill = "white",
                    h_color = viridis::viridis_pal(option = "magma")(100)[1],
                    s_width = 0.7, 
                    s_height = 0.7,
                    h_size = 2,
                    s_x = 1, s_y = 1)
magick::image_read("forwards_hex2.png")%>%
  magick::image_transparent("white") %>%
  magick::image_write("forwards_hex2.png")

forwards_hex2

maelle commented 6 years ago

I vote for the gradient border that I find prettier.

hturner commented 6 years ago

You're right the gradient border is prettier. Will the transparent background cause issues for printing I wonder?

hturner commented 6 years ago

code should live in new forwards/branding repo, thanks

maelle commented 6 years ago

Maybe there should be one with white bg for printing 🤔

maelle commented 6 years ago

I'll send the hex to useR! committee tomorrow if no one comes forward (😂) with feedback before then 😇

hturner commented 6 years ago

Can this issue be closed now?

maelle commented 6 years ago

Yep