Code Monkey home page Code Monkey logo

monochromer's People

Contributors

cararthompson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

raphak

monochromer's Issues

Small Typo in "How can I use it?" Section

Hi Cara,
This a great package. Looking forward to learning more about it in your Workshop for Ukraine today. Just wanted to let you know that there was a small typo in the How can I use it? section.

Instead of remotes::github_install("cararthompson/monochromeR") it should be remotes::install_github("cararthompson/monochromeR").

Thanks,
Kurtis

hex_to_rgb() returns string not matrix

Hi!

Super cool package. I used it to extract hex codes for transparent values of a whole palette to use as different layers of a ggplot2, as the colours represent different levels of data (see below).

To do this I passed a colour palette in hex codes to hex_to_rgb() then used rgba_to_hex() with an alpha value to get the new colour palette. However hex_to_rgb() currently returns the string "r = X, g = Y, b = Z", when a vector of the three colours would be more useful maybe?

My code and function are here:

# set colours for plot
colours <- RColorBrewer::brewer.pal(10, 'Spectral')

# function to make points lighter but not transparent
alpha_hex <- function(hex_code, alpha = 1){
  # split by ',' and extract number
  temp <- monochromeR::hex_to_rgb(hex_code) %>%
    str_split(., ',') %>%
    .[[1]] %>%
    parse_number
  
  return(rgba_to_hex(c(temp, alpha)))
}

purrr::map_vec(colours, alpha_hex, alpha = 0.7)

pcoa_all_panel

Generate a ggplot object from view_palette() instead of a base R plot

view_palette() currently uses scales::show_col() to generate a visual representation of a chart, which uses plot() to generate base R plot.

It would be convenient if view_palette() generated a ggplot object so that it could be passed into colorblindr::cvd_grid() to check how a palette appears for folks with colour blindness.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.