Kuan-Liu-Lab / causens

An R package for causal sensitivity analysis methods
https://kuan-liu-lab.github.io/causens/
MIT License
1 stars 0 forks source link

Adding package logo 🎨 #38

Closed larryshamalama closed 2 months ago

larryshamalama commented 4 months ago

Closes #7 👨‍🎨

This is the first draft of the package logo :)

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (f37e7c2) 91.46% compared to head (0511699) 91.46%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #38 +/- ## ======================================= Coverage 91.46% 91.46% ======================================= Files 3 3 Lines 82 82 ======================================= Hits 75 75 Misses 7 7 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

larryshamalama commented 4 months ago

"causens" name should be bigger

larryshamalama commented 4 months ago

R code to generate logos

library(hexSticker)
library(magick)

for (num in 4:6) {
  input_file <- paste0("\~/Downloads/causens-logo-", num, ".png")
  output_file <- paste0("\~/org/research-work/kuan-lab/causens/logo-", num, ".png")

  sticker(input_file,
          package="causens",
          h_size = 1.25, h_color = "#00252f", h_fill = NA,
          p_x = 1000, p_y = 500, p_size = 8, p_color = "black",
          s_x = 0.985, s_y = 0.99, s_width = 1, dpi = 1000,
          white_around_sticker = TRUE,
          filename = output_file)

  p <- image_read(output_file)

  # Fuzziness level for color matching
  fuzz <- 50

  # Transparency adjustments
  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 = output_file)

}
file.show(output_file)