Skip to content

Commit

Permalink
update make_palette
Browse files Browse the repository at this point in the history
  • Loading branch information
cjtexas committed Oct 20, 2023
1 parent 53218f0 commit 6a6ca34
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions R/make_palette.R
Original file line number Diff line number Diff line change
Expand Up @@ -89,22 +89,22 @@ make_palette <- function(colour=NULL, n=7, reverse=FALSE, shuffle=FALSE, default

if (!exists("colour_fun")) {
colour_fun <- default_pal(default)
colour_string <- colour_fun(n)
colour_palette <- colour_fun(n)
} else {
colour_string <- colour_fun(n)
colour_palette <- colour_fun(n)
}

if (reverse) {
colour_string <- rev(colour_fun(n))
colour_palette <- rev(colour_fun(n))
}

if (shuffle) {
set.seed(333)
colour_string <- sample(colour_fun(n))
colour_palette <- sample(colour_fun(n))
}

class(colour_string) <- c("colourgen", class(colour_string))
return(colour_string)
class(colour_palette) <- c("colourgen", class(colour_palette))
return(colour_palette)

}

Expand Down

0 comments on commit 6a6ca34

Please sign in to comment.