Skip to content

Adding color to the background #155

Answered by koenderks
unbrother asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,

Cool that you are trying this out! It's probably best to first make the artwork with NA as the background color and NA as the line color. After that I would extract which color of the diamonds is the least frequent and set the background color with theme_canvas() (this is also applied internally).

An example is given below:

set.seed(1)
palette2 <- randomcoloR::distinctColorPalette(k = 15, altCol = FALSE, runTsne = FALSE)
cols = round(runif(1, 3, 6),0)
pal = palette2[round(runif(cols,1,15),0)]

p <- aRtsy::canvas_diamonds(colors = pal, 
                     background = NA, p = 0, col.line = NA,
                     resolution = 1000)

# Extract least frequent color
back <- names(which…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@unbrother
Comment options

Answer selected by unbrother
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants