├── .Rbuildignore ├── .github ├── .gitignore └── workflows │ ├── R-CMD-check.yaml │ └── pkgdown.yaml ├── .gitignore ├── DESCRIPTION ├── LICENSE ├── LICENSE.md ├── NAMESPACE ├── R ├── anger_palette.R ├── combo_palette.R ├── hardwired_palette.R ├── justice_palette.R ├── killem_palette.R ├── lightning_palette.R ├── load_palette.R ├── magnetic_palette.R ├── metallica_palette.R ├── metallicart.R ├── puppets_palette.R ├── reload_palette.R └── seasons_palette.R ├── _pkgdown.yml ├── docs └── tmp.txt ├── man ├── anger_pal.Rd ├── combo_pal.Rd ├── figures │ ├── README-ajfa-1.png │ ├── README-ajfa-2.png │ ├── README-combo-1.png │ ├── README-destruct-1.png │ ├── README-destruct-2.png │ ├── README-first4-1.png │ ├── README-first4-2.png │ ├── README-first4-3.png │ ├── README-first4-4.png │ ├── README-frantic-1.png │ ├── README-frantic-2.png │ ├── README-frantic-3.png │ ├── README-frantic-4.png │ ├── README-kill-1.png │ ├── README-kill-2.png │ ├── README-load-1.png │ ├── README-load-2.png │ ├── README-magnetic-1.png │ ├── README-magnetic-2.png │ ├── README-metallica-1.png │ ├── README-metallica-2.png │ ├── README-mop-1.png │ ├── README-mop-2.png │ ├── README-reload-1.png │ ├── README-reload-2.png │ ├── README-roam-1.png │ ├── README-roam-2.png │ ├── README-roam-3.png │ ├── README-rtl-1.png │ ├── README-rtl-2.png │ ├── README-seasons-1.png │ ├── README-seasons-2.png │ ├── README-stanger-1.png │ ├── README-stanger-2.png │ ├── metallicart.jpg │ └── metallicart.png ├── hardwired_pal.Rd ├── justice_pal.Rd ├── killem_pal.Rd ├── lightning_pal.Rd ├── load_pal.Rd ├── magnetic_pal.Rd ├── metalli_palette.Rd ├── metallica_pal.Rd ├── puppets_pal.Rd ├── reload_pal.Rd └── seasons_pal.Rd ├── metallicaRt.Rproj ├── readme.md └── readme.rmd /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^LICENSE\.md$ 2 | ^.*\.Rproj$ 3 | ^\.Rproj\.user$ 4 | readme.md 5 | readme.rmd 6 | ^\.travis\.yml$ 7 | ^README\.Rmd$ 8 | ^README-.*\.png$ 9 | ^_pkgdown\.yml$ 10 | ^docs$ 11 | ^pkgdown$ 12 | ^\.github$ 13 | -------------------------------------------------------------------------------- /.github/.gitignore: -------------------------------------------------------------------------------- 1 | *.html 2 | -------------------------------------------------------------------------------- /.github/workflows/R-CMD-check.yaml: -------------------------------------------------------------------------------- 1 | # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples 2 | # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help 3 | on: 4 | push: 5 | branches: [main, master] 6 | pull_request: 7 | branches: [main, master] 8 | 9 | name: R-CMD-check 10 | 11 | jobs: 12 | R-CMD-check: 13 | runs-on: ${{ matrix.config.os }} 14 | 15 | name: ${{ matrix.config.os }} (${{ matrix.config.r }}) 16 | 17 | strategy: 18 | fail-fast: false 19 | matrix: 20 | config: 21 | - {os: macos-latest, r: 'release'} 22 | - {os: windows-latest, r: 'release'} 23 | - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} 24 | - {os: ubuntu-latest, r: 'release'} 25 | - {os: ubuntu-latest, r: 'oldrel-1'} 26 | 27 | env: 28 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 29 | R_KEEP_PKG_SOURCE: yes 30 | 31 | steps: 32 | - uses: actions/checkout@v3 33 | 34 | - uses: r-lib/actions/setup-pandoc@v2 35 | 36 | - uses: r-lib/actions/setup-r@v2 37 | with: 38 | r-version: ${{ matrix.config.r }} 39 | http-user-agent: ${{ matrix.config.http-user-agent }} 40 | use-public-rspm: true 41 | 42 | - uses: r-lib/actions/setup-r-dependencies@v2 43 | with: 44 | extra-packages: any::rcmdcheck 45 | needs: check 46 | 47 | - uses: r-lib/actions/check-r-package@v2 48 | with: 49 | upload-snapshots: true 50 | -------------------------------------------------------------------------------- /.github/workflows/pkgdown.yaml: -------------------------------------------------------------------------------- 1 | # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples 2 | # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help 3 | on: 4 | push: 5 | branches: [main, master] 6 | pull_request: 7 | branches: [main, master] 8 | release: 9 | types: [published] 10 | workflow_dispatch: 11 | 12 | name: pkgdown 13 | 14 | jobs: 15 | pkgdown: 16 | runs-on: ubuntu-latest 17 | # Only restrict concurrency for non-PR jobs 18 | concurrency: 19 | group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} 20 | env: 21 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 22 | permissions: 23 | contents: write 24 | steps: 25 | - uses: actions/checkout@v3 26 | 27 | - uses: r-lib/actions/setup-pandoc@v2 28 | 29 | - uses: r-lib/actions/setup-r@v2 30 | with: 31 | use-public-rspm: true 32 | 33 | - uses: r-lib/actions/setup-r-dependencies@v2 34 | with: 35 | extra-packages: any::pkgdown, local::. 36 | needs: website 37 | 38 | - name: Build site 39 | run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) 40 | shell: Rscript {0} 41 | 42 | - name: Deploy to GitHub pages 🚀 43 | if: github.event_name != 'pull_request' 44 | uses: JamesIves/github-pages-deploy-action@v4.4.1 45 | with: 46 | clean: false 47 | branch: gh-pages 48 | folder: docs 49 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # History files 2 | .Rhistory 3 | .Rapp.history 4 | 5 | # Session Data files 6 | .RData 7 | 8 | # User-specific files 9 | .Ruserdata 10 | 11 | # Example code in package build process 12 | *-Ex.R 13 | 14 | # Output files from R CMD build 15 | /*.tar.gz 16 | 17 | # Output files from R CMD check 18 | /*.Rcheck/ 19 | 20 | # RStudio files 21 | .Rproj.user/ 22 | 23 | # produced vignettes 24 | vignettes/*.html 25 | vignettes/*.pdf 26 | 27 | # OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3 28 | .httr-oauth 29 | 30 | # knitr and R markdown default cache directories 31 | *_cache/ 32 | /cache/ 33 | 34 | # Temporary files created by R markdown 35 | *.utf8.md 36 | *.knit.md 37 | 38 | # R Environment Variables 39 | .Renviron 40 | 41 | docs 42 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: metallicaRt 2 | Title: Colour palettes based on Metallica studio album covers 3 | Version: 0.0.0.9000 4 | Authors@R: 5 | person(given = "John", 6 | family = "MacKintosh", 7 | role = c("aut", "cre"), 8 | email = "johnmackintosh.jm@gmail.com") 9 | Description: Colour palettes based on Metallica studio album covers. 10 | License: MIT + file LICENSE 11 | Encoding: UTF-8 12 | LazyData: true 13 | Roxygen: list(markdown = TRUE) 14 | RoxygenNote: 7.2.3 15 | Imports: 16 | ggplot2, 17 | scales, 18 | glue 19 | Suggests: 20 | dplyr, 21 | gapminder 22 | URL: https://github.com/johnmackintosh/metallicaRt 23 | BugReports: https://github.com/johnmackintosh/metallicaRt/issues 24 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | YEAR: 2020 2 | COPYRIGHT HOLDER: John MacKintosh 3 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # MIT License 2 | 3 | Copyright (c) 2020 John MacKintosh 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | S3method(print,palette) 4 | export(anger_pal) 5 | export(combo_pal) 6 | export(hardwired_pal) 7 | export(justice_pal) 8 | export(killem_pal) 9 | export(lightning_pal) 10 | export(load_pal) 11 | export(magnetic_pal) 12 | export(metalli_palette) 13 | export(metallica_pal) 14 | export(puppets_pal) 15 | export(reload_pal) 16 | export(scale_color_anger) 17 | export(scale_color_combo) 18 | export(scale_color_hardwired) 19 | export(scale_color_justice) 20 | export(scale_color_killem) 21 | export(scale_color_lightning) 22 | export(scale_color_load) 23 | export(scale_color_magnetic) 24 | export(scale_color_metallica) 25 | export(scale_color_puppets) 26 | export(scale_color_reload) 27 | export(scale_color_seasons) 28 | export(scale_colour_anger) 29 | export(scale_colour_combo) 30 | export(scale_colour_hardwired) 31 | export(scale_colour_justice) 32 | export(scale_colour_killem) 33 | export(scale_colour_lightning) 34 | export(scale_colour_load) 35 | export(scale_colour_magnetic) 36 | export(scale_colour_metallica) 37 | export(scale_colour_puppets) 38 | export(scale_colour_reload) 39 | export(scale_colour_seasons) 40 | export(scale_fill_anger) 41 | export(scale_fill_combo) 42 | export(scale_fill_hardwired) 43 | export(scale_fill_justice) 44 | export(scale_fill_killem) 45 | export(scale_fill_lightning) 46 | export(scale_fill_load) 47 | export(scale_fill_magnetic) 48 | export(scale_fill_metallica) 49 | export(scale_fill_puppets) 50 | export(scale_fill_reload) 51 | export(scale_fill_seasons) 52 | export(seasons_pal) 53 | importFrom(ggplot2,discrete_scale) 54 | importFrom(ggplot2,scale_color_gradientn) 55 | importFrom(ggplot2,scale_fill_gradientn) 56 | importFrom(glue,glue) 57 | importFrom(grDevices,colorRampPalette) 58 | importFrom(grDevices,rgb) 59 | importFrom(graphics,image) 60 | importFrom(graphics,par) 61 | importFrom(graphics,rect) 62 | importFrom(graphics,text) 63 | importFrom(scales,manual_pal) 64 | -------------------------------------------------------------------------------- /R/anger_palette.R: -------------------------------------------------------------------------------- 1 | anger_palette <- c("#E3001E", "#FE4002", "#000600", "#E70024", "#F3ABB9", 2 | "#1B0000", "#FF0025", "#4B0000", "#882600", "#AE3000") 3 | 4 | #' @title anger palette 5 | #' @description anger palette 6 | #' @inheritDotParams ggplot2::discrete_scale 7 | #' @param n number of colors 8 | #' @param type discrete or continuous 9 | #' @param reverse reverse order, Default: FALSE 10 | #' @rdname anger_pal 11 | #' @examples 12 | #' library(scales) 13 | #' show_col(anger_pal()(10),labels = FALSE) 14 | #' @export 15 | #' @importFrom scales manual_pal 16 | #' @importFrom glue glue 17 | #' @importFrom grDevices colorRampPalette 18 | 19 | anger_pal <- function(n, type = c("discrete", "continuous"), 20 | reverse = FALSE){ 21 | anger <- anger_palette 22 | 23 | if (reverse == TRUE) { 24 | anger <- rev(anger) 25 | } 26 | 27 | if (missing(n)) { 28 | n <- length(anger) 29 | } 30 | 31 | type <- match.arg(type) 32 | 33 | if (type == "discrete" && n > length(anger)) { 34 | stop(glue::glue("Palette does not have {n} colors, maximum is {length(anger)}!")) 35 | } 36 | 37 | anger <- switch(type, 38 | continuous = grDevices::colorRampPalette(anger)(n), 39 | discrete = anger[1:n]) 40 | 41 | anger <- scales::manual_pal(anger) 42 | 43 | return(anger) 44 | } 45 | 46 | #' @title scale_color_anger 47 | #' @rdname anger_pal 48 | #' @export 49 | #' @examples 50 | #' 51 | #' library(ggplot2) 52 | #' ggplot(airquality, aes(x = Day, y = Temp, 53 | #' group = as.factor(Month), color = as.factor(Month))) + 54 | #' geom_point(size = 2.5) + 55 | #' scale_color_anger() 56 | #' @importFrom ggplot2 discrete_scale scale_color_gradientn 57 | 58 | scale_color_anger <- function(n, type = "discrete", 59 | reverse = FALSE, ...){ 60 | if (type == "discrete") { 61 | ggplot2::discrete_scale("color", "anger", 62 | anger_pal(n = n, type = type, 63 | reverse = reverse), ...) 64 | } else { 65 | ggplot2::scale_color_gradientn(colors = anger_pal(n = n, type = type, 66 | reverse = reverse)(8)) 67 | } 68 | } 69 | 70 | #' @title scale_colour_anger 71 | #' @rdname anger_pal 72 | #' @export 73 | #' @examples 74 | #' 75 | #' ggplot(airquality, aes(x = Day, y = Temp, 76 | #' group = as.factor(Month), color = as.factor(Month))) + 77 | #' geom_point(size = 2.5) + 78 | #' scale_colour_anger() 79 | #' @importFrom ggplot2 discrete_scale scale_color_gradientn 80 | 81 | scale_colour_anger <- scale_color_anger 82 | 83 | #' @title scale_fill_anger 84 | #' @rdname anger_pal 85 | #' @export 86 | #' @examples 87 | #' 88 | #' ggplot(mpg, aes(displ)) + 89 | #' geom_histogram(aes(fill = class), 90 | #' col = "black", size = 0.1) + 91 | #' scale_fill_anger() 92 | #' @importFrom ggplot2 discrete_scale scale_fill_gradientn 93 | 94 | scale_fill_anger <- function(n, type = "discrete", 95 | reverse = FALSE, ...){ 96 | if (type == "discrete") { 97 | ggplot2::discrete_scale("fill", "anger", 98 | anger_pal(n = n, type = type, 99 | reverse = reverse), ...) 100 | } else { 101 | ggplot2::scale_fill_gradientn(colors = anger_pal(n = n, type = type, 102 | reverse = reverse)(10)) 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /R/combo_palette.R: -------------------------------------------------------------------------------- 1 | combo_palette <- c("#9a9693","#e3e3d1", "#a9aec0", "#39497d", "#61a28b", 2 | "#fba104", "#f24108", "#582017", "#8C031F", "#000000") 3 | 4 | #' @title combo palette 5 | #' @description combo palette 6 | #' @inheritDotParams ggplot2::discrete_scale 7 | #' @param n number of colors 8 | #' @param type discrete or continuous 9 | #' @param reverse reverse order, Default: FALSE 10 | #' @rdname combo_pal 11 | #' @examples 12 | #' library(scales) 13 | #' show_col(combo_pal()(10),,labels = FALSE) 14 | #' @export 15 | #' @importFrom scales manual_pal 16 | #' @importFrom glue glue 17 | #' @importFrom grDevices colorRampPalette 18 | 19 | combo_pal <- function(n, type = c("discrete", "continuous"), 20 | reverse = FALSE){ 21 | combo <- combo_palette 22 | 23 | if (reverse == TRUE) { 24 | combo <- rev(combo) 25 | } 26 | 27 | if (missing(n)) { 28 | n <- length(combo) 29 | } 30 | 31 | type <- match.arg(type) 32 | 33 | if (type == "discrete" && n > length(combo)) { 34 | stop(glue::glue("Palette does not have {n} colors, maximum is {length(combo)}!")) 35 | } 36 | 37 | combo <- switch(type, 38 | continuous = grDevices::colorRampPalette(combo)(n), 39 | discrete = combo[1:n]) 40 | 41 | combo <- scales::manual_pal(combo) 42 | 43 | return(combo) 44 | } 45 | 46 | #' @title scale_color_combo 47 | #' @rdname combo_pal 48 | #' @export 49 | #' @examples 50 | #' 51 | #' library(ggplot2) 52 | #' ggplot(airquality, aes(x = Day, y = Temp, 53 | #' group = as.factor(Month), color = as.factor(Month))) + 54 | #' geom_point(size = 2.5) + 55 | #' scale_color_combo() 56 | #' @importFrom ggplot2 discrete_scale scale_color_gradientn 57 | 58 | scale_color_combo <- function(n, type = "discrete", 59 | reverse = FALSE, ...){ 60 | if (type == "discrete") { 61 | ggplot2::discrete_scale("color", "combo", 62 | combo_pal(n = n, type = type, 63 | reverse = reverse), ...) 64 | } else { 65 | ggplot2::scale_color_gradientn(colors = combo_pal(n = n, type = type, 66 | reverse = reverse)(8)) 67 | } 68 | } 69 | 70 | #' @title scale_colour_combo 71 | #' @rdname combo_pal 72 | #' @export 73 | #' @examples 74 | #' 75 | #' ggplot(airquality, aes(x = Day, y = Temp, 76 | #' group = as.factor(Month), color = as.factor(Month))) + 77 | #' geom_point(size = 2.5) + 78 | #' scale_colour_combo() 79 | #' @importFrom ggplot2 discrete_scale scale_color_gradientn 80 | 81 | scale_colour_combo <- scale_color_combo 82 | 83 | #' @title scale_fill_combo 84 | #' @rdname combo_pal 85 | #' @export 86 | #' @examples 87 | #' 88 | #' ggplot(mpg, aes(displ)) + 89 | #' geom_histogram(aes(fill = class), 90 | #' col = "black", size = 0.1) + 91 | #' scale_fill_combo() 92 | #' @importFrom ggplot2 discrete_scale scale_fill_gradientn 93 | 94 | scale_fill_combo <- function(n, type = "discrete", 95 | reverse = FALSE, ...){ 96 | if (type == "discrete") { 97 | ggplot2::discrete_scale("fill", "combo", 98 | combo_pal(n = n, type = type, 99 | reverse = reverse), ...) 100 | } else { 101 | ggplot2::scale_fill_gradientn(colors = combo_pal(n = n, type = type, 102 | reverse = reverse)(10)) 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /R/hardwired_palette.R: -------------------------------------------------------------------------------- 1 | hardwired_palette <- c("#FFFFFF", "#000000", "#440000", "#353535", "#ACACAC" , 2 | "#7B0000", "#585858" , "#6D450A" ,"#C19824", "#C05A41") 3 | 4 | #' @title hardwired palette 5 | #' @description hardwired palette 6 | #' @inheritDotParams ggplot2::discrete_scale 7 | #' @param n number of colors 8 | #' @param type discrete or continuous 9 | #' @param reverse reverse order, Default: FALSE 10 | #' @rdname hardwired_pal 11 | #' @examples 12 | #' library(scales) 13 | #' show_col(hardwired_pal()(10),labels = FALSE) 14 | #' @export 15 | #' @importFrom scales manual_pal 16 | #' @importFrom glue glue 17 | #' @importFrom grDevices colorRampPalette 18 | 19 | hardwired_pal <- function(n, type = c("discrete", "continuous"), 20 | reverse = FALSE){ 21 | hardwired <- hardwired_palette 22 | 23 | if (reverse == TRUE) { 24 | hardwired <- rev(hardwired) 25 | } 26 | 27 | if (missing(n)) { 28 | n <- length(hardwired) 29 | } 30 | 31 | type <- match.arg(type) 32 | 33 | if (type == "discrete" && n > length(hardwired)) { 34 | stop(glue::glue("Palette does not have {n} colors, maximum is {length(hardwired)}!")) 35 | } 36 | 37 | hardwired <- switch(type, 38 | continuous = grDevices::colorRampPalette(hardwired)(n), 39 | discrete = hardwired[1:n]) 40 | 41 | hardwired <- scales::manual_pal(hardwired) 42 | 43 | return(hardwired) 44 | } 45 | 46 | #' @title scale_color_hardwired 47 | #' @rdname hardwired_pal 48 | #' @export 49 | #' @examples 50 | #' 51 | #' library(ggplot2) 52 | #' ggplot(airquality, aes(x = Day, y = Temp, 53 | #' group = as.factor(Month), color = as.factor(Month))) + 54 | #' geom_point(size = 2.5) + 55 | #' scale_color_hardwired() 56 | #' @importFrom ggplot2 discrete_scale scale_color_gradientn 57 | 58 | scale_color_hardwired <- function(n, type = "discrete", 59 | reverse = FALSE, ...){ 60 | if (type == "discrete") { 61 | ggplot2::discrete_scale("color", "hardwired", 62 | hardwired_pal(n = n, type = type, 63 | reverse = reverse), ...) 64 | } else { 65 | ggplot2::scale_color_gradientn(colors = hardwired_pal(n = n, type = type, 66 | reverse = reverse)(8)) 67 | } 68 | } 69 | 70 | #' @title scale_colour_hardwired 71 | #' @rdname hardwired_pal 72 | #' @export 73 | #' @examples 74 | #' 75 | #' ggplot(airquality, aes(x = Day, y = Temp, 76 | #' group = as.factor(Month), color = as.factor(Month))) + 77 | #' geom_point(size = 2.5) + 78 | #' scale_colour_hardwired() 79 | #' @importFrom ggplot2 discrete_scale scale_color_gradientn 80 | 81 | scale_colour_hardwired <- scale_color_hardwired 82 | 83 | #' @title scale_fill_hardwired 84 | #' @rdname hardwired_pal 85 | #' @export 86 | #' @examples 87 | #' 88 | #' ggplot(mpg, aes(displ)) + 89 | #' geom_histogram(aes(fill = class), 90 | #' col = "black", size = 0.1) + 91 | #' scale_fill_hardwired() 92 | #' @importFrom ggplot2 discrete_scale scale_fill_gradientn 93 | 94 | scale_fill_hardwired <- function(n, type = "discrete", 95 | reverse = FALSE, ...){ 96 | if (type == "discrete") { 97 | ggplot2::discrete_scale("fill", "hardwired", 98 | hardwired_pal(n = n, type = type, 99 | reverse = reverse), ...) 100 | } else { 101 | ggplot2::scale_fill_gradientn(colors = hardwired_pal(n = n, type = type, 102 | reverse = reverse)(10)) 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /R/justice_palette.R: -------------------------------------------------------------------------------- 1 | justice_palette <- c("#FFFFEC", "#F3F2DE", "#D7D9CC", "#000200", "#D2D4C7", 2 | "#BDBEB0", "#A1A7A3", "#7E8985", "#535E5A", "#2B3F46") 3 | 4 | #' @title justice palette 5 | #' @description justice palette 6 | #' @inheritDotParams ggplot2::discrete_scale 7 | #' @param n number of colors 8 | #' @param type discrete or continuous 9 | #' @param reverse reverse order, Default: FALSE 10 | #' @rdname justice_pal 11 | #' @examples 12 | #' library(scales) 13 | #' show_col(justice_pal()(10),labels = FALSE) 14 | #' @export 15 | #' @importFrom scales manual_pal 16 | #' @importFrom glue glue 17 | #' @importFrom grDevices colorRampPalette 18 | 19 | justice_pal <- function(n, type = c("discrete", "continuous"), 20 | reverse = FALSE){ 21 | justice <- justice_palette 22 | 23 | if (reverse == TRUE) { 24 | justice <- rev(justice) 25 | } 26 | 27 | if (missing(n)) { 28 | n <- length(justice) 29 | } 30 | 31 | type <- match.arg(type) 32 | 33 | if (type == "discrete" && n > length(justice)) { 34 | stop(glue::glue("Palette does not have {n} colors, maximum is {length(justice)}!")) 35 | } 36 | 37 | justice <- switch(type, 38 | continuous = grDevices::colorRampPalette(justice)(n), 39 | discrete = justice[1:n]) 40 | 41 | justice <- scales::manual_pal(justice) 42 | 43 | return(justice) 44 | } 45 | 46 | #' @title scale_color_justice 47 | #' @rdname justice_pal 48 | #' @export 49 | #' @examples 50 | #' 51 | #' library(ggplot2) 52 | #' ggplot(airquality, aes(x = Day, y = Temp, 53 | #' group = as.factor(Month), color = as.factor(Month))) + 54 | #' geom_point(size = 2.5) + 55 | #' scale_color_justice() 56 | #' @importFrom ggplot2 discrete_scale scale_color_gradientn 57 | 58 | scale_color_justice <- function(n, type = "discrete", 59 | reverse = FALSE, ...){ 60 | if (type == "discrete") { 61 | ggplot2::discrete_scale("color", "justice", 62 | justice_pal(n = n, type = type, 63 | reverse = reverse), ...) 64 | } else { 65 | ggplot2::scale_color_gradientn(colors = justice_pal(n = n, type = type, 66 | reverse = reverse)(8)) 67 | } 68 | } 69 | 70 | #' @title scale_colour_justice 71 | #' @rdname justice_pal 72 | #' @export 73 | #' @examples 74 | #' 75 | #' ggplot(airquality, aes(x = Day, y = Temp, 76 | #' group = as.factor(Month), color = as.factor(Month))) + 77 | #' geom_point(size = 2.5) + 78 | #' scale_colour_justice() 79 | #' @importFrom ggplot2 discrete_scale scale_color_gradientn 80 | 81 | scale_colour_justice <- scale_color_justice 82 | 83 | #' @title scale_fill_justice 84 | #' @rdname justice_pal 85 | #' @export 86 | #' @examples 87 | #' 88 | #' ggplot(mpg, aes(displ)) + 89 | #' geom_histogram(aes(fill = class), 90 | #' col = "black", size = 0.1) + 91 | #' scale_fill_justice() 92 | #' @importFrom ggplot2 discrete_scale scale_fill_gradientn 93 | 94 | scale_fill_justice <- function(n, type = "discrete", 95 | reverse = FALSE, ...){ 96 | if (type == "discrete") { 97 | ggplot2::discrete_scale("fill", "justice", 98 | justice_pal(n = n, type = type, 99 | reverse = reverse), ...) 100 | } else { 101 | ggplot2::scale_fill_gradientn(colors = justice_pal(n = n, type = type, 102 | reverse = reverse)(10)) 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /R/killem_palette.R: -------------------------------------------------------------------------------- 1 | killem_palette <- c("#000000", "#E4E6D8", "#A8A8A8", "#CE0000", "#FF0204", 2 | "#7D0109", "#DCFFFE", "#EEE2E4", "#E9ACA7", "#F83634") 3 | 4 | #' @title killem palette 5 | #' @description killem palette 6 | #' @inheritDotParams ggplot2::discrete_scale 7 | #' @param n number of colors 8 | #' @param type discrete or continuous 9 | #' @param reverse reverse order, Default: FALSE 10 | #' @rdname killem_pal 11 | #' @examples 12 | #' library(scales) 13 | #' show_col(killem_pal()(10),labels = FALSE) 14 | #' @export 15 | #' @importFrom scales manual_pal 16 | #' @importFrom glue glue 17 | #' @importFrom grDevices colorRampPalette 18 | 19 | killem_pal <- function(n, type = c("discrete", "continuous"), 20 | reverse = FALSE){ 21 | killem <- killem_palette 22 | 23 | if (reverse == TRUE) { 24 | killem <- rev(killem) 25 | } 26 | 27 | if (missing(n)) { 28 | n <- length(killem) 29 | } 30 | 31 | type <- match.arg(type) 32 | 33 | if (type == "discrete" && n > length(killem)) { 34 | stop(glue::glue("Palette does not have {n} colors, maximum is {length(killem)}!")) 35 | } 36 | 37 | killem <- switch(type, 38 | continuous = grDevices::colorRampPalette(killem)(n), 39 | discrete = killem[1:n]) 40 | 41 | killem <- scales::manual_pal(killem) 42 | 43 | return(killem) 44 | } 45 | 46 | #' @title scale_color_killem 47 | #' @rdname killem_pal 48 | #' @export 49 | #' @examples 50 | #' 51 | #' library(ggplot2) 52 | #' ggplot(airquality, aes(x = Day, y = Temp, 53 | #' group = as.factor(Month), color = as.factor(Month))) + 54 | #' geom_point(size = 2.5) + 55 | #' scale_color_killem() 56 | #' @importFrom ggplot2 discrete_scale scale_color_gradientn 57 | 58 | scale_color_killem <- function(n, type = "discrete", 59 | reverse = FALSE, ...){ 60 | if (type == "discrete") { 61 | ggplot2::discrete_scale("color", "killem", 62 | killem_pal(n = n, type = type, 63 | reverse = reverse), ...) 64 | } else { 65 | ggplot2::scale_color_gradientn(colors = killem_pal(n = n, type = type, 66 | reverse = reverse)(8)) 67 | } 68 | } 69 | 70 | #' @title scale_colour_killem 71 | #' @rdname killem_pal 72 | #' @export 73 | #' @examples 74 | #' 75 | #' ggplot(airquality, aes(x = Day, y = Temp, 76 | #' group = as.factor(Month), color = as.factor(Month))) + 77 | #' geom_point(size = 2.5) + 78 | #' scale_colour_killem() 79 | #' @importFrom ggplot2 discrete_scale scale_color_gradientn 80 | 81 | scale_colour_killem <- scale_color_killem 82 | 83 | #' @title scale_fill_killem 84 | #' @rdname killem_pal 85 | #' @export 86 | #' @examples 87 | #' 88 | #' ggplot(mpg, aes(displ)) + 89 | #' geom_histogram(aes(fill = class), 90 | #' col = "black", size = 0.1) + 91 | #' scale_fill_killem() 92 | #' @importFrom ggplot2 discrete_scale scale_fill_gradientn 93 | 94 | scale_fill_killem <- function(n, type = "discrete", 95 | reverse = FALSE, ...){ 96 | if (type == "discrete") { 97 | ggplot2::discrete_scale("fill", "killem", 98 | killem_pal(n = n, type = type, 99 | reverse = reverse), ...) 100 | } else { 101 | ggplot2::scale_fill_gradientn(colors = killem_pal(n = n, type = type, 102 | reverse = reverse)(10)) 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /R/lightning_palette.R: -------------------------------------------------------------------------------- 1 | lightning_palette <- c("#030305", "#1D1638", "#090712", "#1E183C", "#FBFFFF", 2 | "#20255F", "#233776", "#3A5A93", "#9CAAC7", "#6A84B7") 3 | 4 | #' @title lightning palette 5 | #' @description lightning palette 6 | #' @inheritDotParams ggplot2::discrete_scale 7 | #' @param n number of colors 8 | #' @param type discrete or continuous 9 | #' @param reverse reverse order, Default: FALSE 10 | #' @rdname lightning_pal 11 | #' @examples 12 | #' library(scales) 13 | #' show_col(lightning_pal()(10),labels = FALSE) 14 | #' @export 15 | #' @importFrom scales manual_pal 16 | #' @importFrom glue glue 17 | #' @importFrom grDevices colorRampPalette 18 | 19 | lightning_pal <- function(n, type = c("discrete", "continuous"), 20 | reverse = FALSE){ 21 | lightning <- lightning_palette 22 | 23 | if (reverse == TRUE) { 24 | lightning <- rev(lightning) 25 | } 26 | 27 | if (missing(n)) { 28 | n <- length(lightning) 29 | } 30 | 31 | type <- match.arg(type) 32 | 33 | if (type == "discrete" && n > length(lightning)) { 34 | stop(glue::glue("Palette does not have {n} colors, maximum is {length(lightning)}!")) 35 | } 36 | 37 | lightning <- switch(type, 38 | continuous = grDevices::colorRampPalette(lightning)(n), 39 | discrete = lightning[1:n]) 40 | 41 | lightning <- scales::manual_pal(lightning) 42 | 43 | return(lightning) 44 | } 45 | 46 | #' @title scale_color_lightning 47 | #' @rdname lightning_pal 48 | #' @export 49 | #' @examples 50 | #' 51 | #' library(ggplot2) 52 | #' ggplot(airquality, aes(x = Day, y = Temp, 53 | #' group = as.factor(Month), color = as.factor(Month))) + 54 | #' geom_point(size = 2.5) + 55 | #' scale_color_lightning() 56 | #' @importFrom ggplot2 discrete_scale scale_color_gradientn 57 | 58 | scale_color_lightning <- function(n, type = "discrete", 59 | reverse = FALSE, ...){ 60 | if (type == "discrete") { 61 | ggplot2::discrete_scale("color", "lightning", 62 | lightning_pal(n = n, type = type, 63 | reverse = reverse), ...) 64 | } else { 65 | ggplot2::scale_color_gradientn(colors = lightning_pal(n = n, type = type, 66 | reverse = reverse)(8)) 67 | } 68 | } 69 | 70 | #' @title scale_colour_lightning 71 | #' @rdname lightning_pal 72 | #' @export 73 | #' @examples 74 | #' 75 | #' ggplot(airquality, aes(x = Day, y = Temp, 76 | #' group = as.factor(Month), color = as.factor(Month))) + 77 | #' geom_point(size = 2.5) + 78 | #' scale_colour_lightning() 79 | #' @importFrom ggplot2 discrete_scale scale_color_gradientn 80 | 81 | scale_colour_lightning <- scale_color_lightning 82 | 83 | #' @title scale_fill_lightning 84 | #' @rdname lightning_pal 85 | #' @export 86 | #' @examples 87 | #' 88 | #' ggplot(mpg, aes(displ)) + 89 | #' geom_histogram(aes(fill = class), 90 | #' col = "black", size = 0.1) + 91 | #' scale_fill_lightning() 92 | #' @importFrom ggplot2 discrete_scale scale_fill_gradientn 93 | 94 | scale_fill_lightning <- function(n, type = "discrete", 95 | reverse = FALSE, ...){ 96 | if (type == "discrete") { 97 | ggplot2::discrete_scale("fill", "lightning", 98 | lightning_pal(n = n, type = type, 99 | reverse = reverse), ...) 100 | } else { 101 | ggplot2::scale_fill_gradientn(colors = lightning_pal(n = n, type = type, 102 | reverse = reverse)(10)) 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /R/load_palette.R: -------------------------------------------------------------------------------- 1 | load_palette <- c("#000000", "#101010", "#B1B1B1", "#FFFFFF", "#717171", 2 | "#393939", "#B30020", "#FF5C4E", "#ED4D3F", "#E89466") 3 | 4 | #' @title load palette 5 | #' @description load palette 6 | #' @inheritDotParams ggplot2::discrete_scale 7 | #' @param n number of colors 8 | #' @param type discrete or continuous 9 | #' @param reverse reverse order, Default: FALSE 10 | #' @rdname load_pal 11 | #' @examples 12 | #' library(scales) 13 | #' show_col(load_pal()(10),labels = FALSE) 14 | #' @export 15 | #' @importFrom scales manual_pal 16 | #' @importFrom glue glue 17 | #' @importFrom grDevices colorRampPalette 18 | 19 | load_pal <- function(n, type = c("discrete", "continuous"), 20 | reverse = FALSE){ 21 | load <- load_palette 22 | 23 | if (reverse == TRUE) { 24 | load <- rev(load) 25 | } 26 | 27 | if (missing(n)) { 28 | n <- length(load) 29 | } 30 | 31 | type <- match.arg(type) 32 | 33 | if (type == "discrete" && n > length(load)) { 34 | stop(glue::glue("Palette does not have {n} colors, maximum is {length(load)}!")) 35 | } 36 | 37 | load <- switch(type, 38 | continuous = grDevices::colorRampPalette(load)(n), 39 | discrete = load[1:n]) 40 | 41 | load <- scales::manual_pal(load) 42 | 43 | return(load) 44 | } 45 | 46 | #' @title scale_color_load 47 | #' @rdname load_pal 48 | #' @export 49 | #' @examples 50 | #' 51 | #' library(ggplot2) 52 | #' ggplot(airquality, aes(x = Day, y = Temp, 53 | #' group = as.factor(Month), color = as.factor(Month))) + 54 | #' geom_point(size = 2.5) + 55 | #' scale_color_load() 56 | #' @importFrom ggplot2 discrete_scale scale_color_gradientn 57 | 58 | scale_color_load <- function(n, type = "discrete", 59 | reverse = FALSE, ...){ 60 | if (type == "discrete") { 61 | ggplot2::discrete_scale("color", "load", 62 | load_pal(n = n, type = type, 63 | reverse = reverse), ...) 64 | } else { 65 | ggplot2::scale_color_gradientn(colors = load_pal(n = n, type = type, 66 | reverse = reverse)(8)) 67 | } 68 | } 69 | 70 | #' @title scale_colour_load 71 | #' @rdname load_pal 72 | #' @export 73 | #' @examples 74 | #' 75 | #' ggplot(airquality, aes(x = Day, y = Temp, 76 | #' group = as.factor(Month), color = as.factor(Month))) + 77 | #' geom_point(size = 2.5) + 78 | #' scale_colour_load() 79 | #' @importFrom ggplot2 discrete_scale scale_color_gradientn 80 | 81 | scale_colour_load <- scale_color_load 82 | 83 | #' @title scale_fill_load 84 | #' @rdname load_pal 85 | #' @export 86 | #' @examples 87 | #' 88 | #' ggplot(mpg, aes(displ)) + 89 | #' geom_histogram(aes(fill = class), 90 | #' col = "black", size = 0.1) + 91 | #' scale_fill_load() 92 | #' @importFrom ggplot2 discrete_scale scale_fill_gradientn 93 | 94 | scale_fill_load <- function(n, type = "discrete", 95 | reverse = FALSE, ...){ 96 | if (type == "discrete") { 97 | ggplot2::discrete_scale("fill", "load", 98 | load_pal(n = n, type = type, 99 | reverse = reverse), ...) 100 | } else { 101 | ggplot2::scale_fill_gradientn(colors = load_pal(n = n, type = type, 102 | reverse = reverse)(10)) 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /R/magnetic_palette.R: -------------------------------------------------------------------------------- 1 | magnetic_palette <- c("#FFFFFD", "#030000", "#F3F2F0", "#E0DCD9", "#231C16", 2 | "#B9B5B2", "#9C9895", "#8D8986", "#54504D", "#484441") 3 | 4 | #' @title magnetic palette 5 | #' @description magnetic palette 6 | #' @inheritDotParams ggplot2::discrete_scale 7 | #' @param n number of colors 8 | #' @param type discrete or continuous 9 | #' @param reverse reverse order, Default: FALSE 10 | #' @rdname magnetic_pal 11 | #' @examples 12 | #' library(scales) 13 | #' show_col(magnetic_pal()(10),labels = FALSE) 14 | #' @export 15 | #' @importFrom scales manual_pal 16 | #' @importFrom glue glue 17 | #' @importFrom grDevices colorRampPalette 18 | 19 | magnetic_pal <- function(n, type = c("discrete", "continuous"), 20 | reverse = FALSE){ 21 | magnetic <- magnetic_palette 22 | 23 | if (reverse == TRUE) { 24 | magnetic <- rev(magnetic) 25 | } 26 | 27 | if (missing(n)) { 28 | n <- length(magnetic) 29 | } 30 | 31 | type <- match.arg(type) 32 | 33 | if (type == "discrete" && n > length(magnetic)) { 34 | stop(glue::glue("Palette does not have {n} colors, maximum is {length(magnetic)}!")) 35 | } 36 | 37 | magnetic <- switch(type, 38 | continuous = grDevices::colorRampPalette(magnetic)(n), 39 | discrete = magnetic[1:n]) 40 | 41 | magnetic <- scales::manual_pal(magnetic) 42 | 43 | return(magnetic) 44 | } 45 | 46 | #' @title scale_color_magnetic 47 | #' @rdname magnetic_pal 48 | #' @export 49 | #' @examples 50 | #' 51 | #' library(ggplot2) 52 | #' ggplot(airquality, aes(x = Day, y = Temp, 53 | #' group = as.factor(Month), color = as.factor(Month))) + 54 | #' geom_point(size = 2.5) + 55 | #' scale_color_magnetic() 56 | #' @importFrom ggplot2 discrete_scale scale_color_gradientn 57 | 58 | scale_color_magnetic <- function(n, type = "discrete", 59 | reverse = FALSE, ...){ 60 | if (type == "discrete") { 61 | ggplot2::discrete_scale("color", "magnetic", 62 | magnetic_pal(n = n, type = type, 63 | reverse = reverse), ...) 64 | } else { 65 | ggplot2::scale_color_gradientn(colors = magnetic_pal(n = n, type = type, 66 | reverse = reverse)(8)) 67 | } 68 | } 69 | 70 | #' @title scale_colour_magnetic 71 | #' @rdname magnetic_pal 72 | #' @export 73 | #' @examples 74 | #' 75 | #' ggplot(airquality, aes(x = Day, y = Temp, 76 | #' group = as.factor(Month), color = as.factor(Month))) + 77 | #' geom_point(size = 2.5) + 78 | #' scale_colour_magnetic() 79 | #' @importFrom ggplot2 discrete_scale scale_color_gradientn 80 | 81 | scale_colour_magnetic <- scale_color_magnetic 82 | 83 | #' @title scale_fill_magnetic 84 | #' @rdname magnetic_pal 85 | #' @export 86 | #' @examples 87 | #' 88 | #' ggplot(mpg, aes(displ)) + 89 | #' geom_histogram(aes(fill = class), 90 | #' col = "black", size = 0.1) + 91 | #' scale_fill_magnetic() 92 | #' @importFrom ggplot2 discrete_scale scale_fill_gradientn 93 | 94 | scale_fill_magnetic <- function(n, type = "discrete", 95 | reverse = FALSE, ...){ 96 | if (type == "discrete") { 97 | ggplot2::discrete_scale("fill", "magnetic", 98 | magnetic_pal(n = n, type = type, 99 | reverse = reverse), ...) 100 | } else { 101 | ggplot2::scale_fill_gradientn(colors = magnetic_pal(n = n, type = type, 102 | reverse = reverse)(10)) 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /R/metallica_palette.R: -------------------------------------------------------------------------------- 1 | metallica_palette <- c("#000000", "#000002", "#030303", "#050608", "#1D2122", 2 | "#1E2223", "#0B0B0B", "#111516", "#303136", "#484F55") 3 | 4 | #' @title metallica palette 5 | #' @description metallica palette 6 | #' @inheritDotParams ggplot2::discrete_scale 7 | #' @param n number of colors 8 | #' @param type discrete or continuous 9 | #' @param reverse reverse order, Default: FALSE 10 | #' @rdname metallica_pal 11 | #' @examples 12 | #' library(scales) 13 | #' show_col(metallica_pal()(10),labels = FALSE) 14 | #' @export 15 | #' @importFrom scales manual_pal 16 | #' @importFrom glue glue 17 | #' @importFrom grDevices colorRampPalette 18 | 19 | metallica_pal <- function(n, type = c("discrete", "continuous"), 20 | reverse = FALSE){ 21 | metallica <- metallica_palette 22 | 23 | if (reverse == TRUE) { 24 | metallica <- rev(metallica) 25 | } 26 | 27 | if (missing(n)) { 28 | n <- length(metallica) 29 | } 30 | 31 | type <- match.arg(type) 32 | 33 | if (type == "discrete" && n > length(metallica)) { 34 | stop(glue::glue("Palette does not have {n} colors, maximum is {length(metallica)}!")) 35 | } 36 | 37 | metallica <- switch(type, 38 | continuous = grDevices::colorRampPalette(metallica)(n), 39 | discrete = metallica[1:n]) 40 | 41 | metallica <- scales::manual_pal(metallica) 42 | 43 | return(metallica) 44 | } 45 | 46 | #' @title scale_color_metallica 47 | #' @rdname metallica_pal 48 | #' @export 49 | #' @examples 50 | #' 51 | #' library(ggplot2) 52 | #' ggplot(airquality, aes(x = Day, y = Temp, 53 | #' group = as.factor(Month), color = as.factor(Month))) + 54 | #' geom_point(size = 2.5) + 55 | #' scale_color_metallica() 56 | #' @importFrom ggplot2 discrete_scale scale_color_gradientn 57 | 58 | scale_color_metallica <- function(n, type = "discrete", 59 | reverse = FALSE, ...){ 60 | if (type == "discrete") { 61 | ggplot2::discrete_scale("color", "metallica", 62 | metallica_pal(n = n, type = type, 63 | reverse = reverse), ...) 64 | } else { 65 | ggplot2::scale_color_gradientn(colors = metallica_pal(n = n, type = type, 66 | reverse = reverse)(8)) 67 | } 68 | } 69 | 70 | #' @title scale_colour_metallica 71 | #' @rdname metallica_pal 72 | #' @export 73 | #' @examples 74 | #' 75 | #' ggplot(airquality, aes(x = Day, y = Temp, 76 | #' group = as.factor(Month), color = as.factor(Month))) + 77 | #' geom_point(size = 2.5) + 78 | #' scale_colour_metallica() 79 | #' @importFrom ggplot2 discrete_scale scale_color_gradientn 80 | 81 | scale_colour_metallica <- scale_color_metallica 82 | 83 | #' @title scale_fill_metallica 84 | #' @rdname metallica_pal 85 | #' @export 86 | #' @examples 87 | #' 88 | #' ggplot(mpg, aes(displ)) + 89 | #' geom_histogram(aes(fill = class), 90 | #' col = "black", size = 0.1) + 91 | #' scale_fill_metallica() 92 | #' @importFrom ggplot2 discrete_scale scale_fill_gradientn 93 | 94 | scale_fill_metallica <- function(n, type = "discrete", 95 | reverse = FALSE, ...){ 96 | if (type == "discrete") { 97 | ggplot2::discrete_scale("fill", "metallica", 98 | metallica_pal(n = n, type = type, 99 | reverse = reverse), ...) 100 | } else { 101 | ggplot2::scale_fill_gradientn(colors = metallica_pal(n = n, type = type, 102 | reverse = reverse)(10)) 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /R/metallicart.R: -------------------------------------------------------------------------------- 1 | met_palettes <- list( 2 | kill = c("#da8186","#d50d0a","#8F0106","#474747", "#370c0a", "#050404", "#000000"), 3 | rtl = c("#a9aec0","#869CCB", "#8294b7", "#39497d", "#232455", "#0f0d1e","#000000"), 4 | puppets = c("#c3ae95","#9c9996","#D28E01","#b3480a","#582017", "#8C031F","#000000"), 5 | justice = c("#9E9987","#e3e3d1","#33454D","#628c94","#3d4645", "#868d7e","#919c9b"), 6 | metallica = c("#515659","#1b2423","#0b1413","#181b1d","#040404", "#050404","#000000"), 7 | load = c("#AEAEAE","#ddcbbd","#a1a09f","#de5646","#934841", "#0f0c0c","#000000"), 8 | reload = c("#080606","#484848","#9d9c9c","#f0c43e","#fba104", "#e43609","#AD0215"), 9 | anger = c("#8E837F","#d5ada2","#782920","#f24108","#e4041f","#240b0a", "#000000"), 10 | magnetic = c("#2d2520","#e8e6e4","#837F7C","#625c58","#7f7c7a","#9a9693", "#000000"), 11 | hardwired = c("#C8C8C8","#61a28b","#e7cd9b","#7E4611","#a93119", "#2c2625","#000000"), 12 | seasons = c("#fffba8","#ffff01","#b39c00","#836800", "#888752", "#2D2819", "#000000"), 13 | 14 | whiplash = c("#E10A07", "#D4D3C3", "#070505","#443C2C"), 15 | bells = c("#171732", "#B0B4C8", "#8394BA","#5F74A6"), 16 | orion = c("#381712", "#C4A88B", "#9B9A97","#92818D"), 17 | blackened = c("#D6D8C7", "#363F3E", "#6D6B66","#6E7A4A"), 18 | roam = c("#040405", "#242C2C", "#2C2C2C","#4C4C54"), 19 | bleeding = c("#2D1917", "#E16A5C", "#A9A9A8","#948494"), 20 | fuel = c("#090707", "#E5590B", "#ABA7A7","#ECD492"), 21 | frantic = c("#1D0A09", "#DD2414", "#D3B1A2","#928281"), 22 | scarred = c("#CBC9C7", "#251E19", "#554D48","#686661"), 23 | revenge = c("#372421", "#E2B29B", "#7CA896","#6C8C8C"), 24 | inomorata = c("#E8E690", "#EDEA15","#856D0B", "#2A230F") 25 | 26 | ) 27 | 28 | 29 | #' Color Palettes based on Metallica album covers 30 | #' 31 | #' R package that contains color palettes based on colours on Metallica studio album covers. 32 | #' 33 | #' Yep, even the black album. 34 | #' 35 | #' This package is based on the nycpalettes package: https://github.com/kellycotton/nycpalettes 36 | #' 37 | #' @param name Name of palette. Select one: 38 | #' \code{kill}, \code{kill10}, \code{lightning}, \code{lightning10}, 39 | #' \code{puppets}, \code{puppets10},\code{justice}, \code{justice10}, 40 | #' \code{metallica}, \code{metallica10}, \code{load},\code{load10}, 41 | #' \code{reload}, \code{reload10}, \code{anger}, \code{anger10}, 42 | #' \code{magnetic}, \code{magnetic10}, \code{hardwired}, \code{hardwired10}, 43 | #' \code{seasons10}, \code{seasons}, \code{combo}, \code{inomorata} 44 | #' 45 | #' @param n Number of colors desired. 46 | #' 47 | #' Some palettes contain 7 colors which were picked 'by hand' 48 | #' The \code{combo} palette and those ending with '10' have 10 colours. 49 | #' Apart from \code{combo} palette, these were produced with the 50 | #' aid of the \code{colorfindr} package : 51 | #' https://CRAN.R-project.org/package=colorfindr 52 | #' 53 | #' @param type Either continuous or discrete. 54 | #' 55 | #' @return A vector of colors. 56 | #' @export 57 | #' 58 | #' @examples 59 | #' metalli_palette("anger") 60 | #' 61 | metalli_palette <- function(name, n, type = c("discrete", "continuous")) { 62 | type <- match.arg(type) 63 | 64 | pal <- met_palettes[[name]] 65 | if (is.null(pal)) 66 | stop("Palette not found") 67 | 68 | if (missing(n)) { 69 | n = length(pal) 70 | } 71 | 72 | if (type == "discrete" && n > length(pal)) { 73 | stop(paste("You have requested", n, "colors, but this palette only contains", length(pal), "colors.")) 74 | } 75 | 76 | out <- switch(type, 77 | continuous = grDevices::colorRampPalette(pal)(n), 78 | discrete = pal[1:n] 79 | ) 80 | structure(out, class = "palette", name = name) 81 | } 82 | 83 | #' @export 84 | #' @importFrom graphics rect par image text 85 | #' @importFrom grDevices rgb 86 | print.palette <- function(x, ...) { 87 | n <- length(x) 88 | old <- par(mar = c(0.5, 0.5, 0.5, 0.5)) 89 | on.exit(par(old)) 90 | 91 | image(1:n, 1, as.matrix(1:n), col = x, 92 | ylab = "", xaxt = "n", yaxt = "n", bty = "n") 93 | } 94 | -------------------------------------------------------------------------------- /R/puppets_palette.R: -------------------------------------------------------------------------------- 1 | puppets_palette <- c("#000000", "#FFFFFF", "#8C031F", "#CDC6B3", "#330B09", 2 | "#9895A0", "#AD4000", "#55311B", "#6F6F6F", "#9D8D74") 3 | 4 | #' @title puppets palette 5 | #' @description puppets palette 6 | #' @inheritDotParams ggplot2::discrete_scale 7 | #' @param n number of colors 8 | #' @param type discrete or continuous 9 | #' @param reverse reverse order, Default: FALSE 10 | #' @rdname puppets_pal 11 | #' @examples 12 | #' library(scales) 13 | #' show_col(puppets_pal()(10),labels = FALSE) 14 | #' @export 15 | #' @importFrom scales manual_pal 16 | #' @importFrom glue glue 17 | #' @importFrom grDevices colorRampPalette 18 | 19 | puppets_pal <- function(n, type = c("discrete", "continuous"), 20 | reverse = FALSE){ 21 | puppets <- puppets_palette 22 | 23 | if (reverse == TRUE) { 24 | puppets <- rev(puppets) 25 | } 26 | 27 | if (missing(n)) { 28 | n <- length(puppets) 29 | } 30 | 31 | type <- match.arg(type) 32 | 33 | if (type == "discrete" && n > length(puppets)) { 34 | stop(glue::glue("Palette does not have {n} colors, maximum is {length(puppets)}!")) 35 | } 36 | 37 | puppets <- switch(type, 38 | continuous = grDevices::colorRampPalette(puppets)(n), 39 | discrete = puppets[1:n]) 40 | 41 | puppets <- scales::manual_pal(puppets) 42 | 43 | return(puppets) 44 | } 45 | 46 | #' @title scale_color_puppets 47 | #' @rdname puppets_pal 48 | #' @export 49 | #' @examples 50 | #' 51 | #' library(ggplot2) 52 | #' ggplot(airquality, aes(x = Day, y = Temp, 53 | #' group = as.factor(Month), color = as.factor(Month))) + 54 | #' geom_point(size = 2.5) + 55 | #' scale_color_puppets() 56 | #' @importFrom ggplot2 discrete_scale scale_color_gradientn 57 | 58 | scale_color_puppets <- function(n, type = "discrete", 59 | reverse = FALSE, ...){ 60 | if (type == "discrete") { 61 | ggplot2::discrete_scale("color", "puppets", 62 | puppets_pal(n = n, type = type, 63 | reverse = reverse), ...) 64 | } else { 65 | ggplot2::scale_color_gradientn(colors = puppets_pal(n = n, type = type, 66 | reverse = reverse)(8)) 67 | } 68 | } 69 | 70 | #' @title scale_colour_puppets 71 | #' @rdname puppets_pal 72 | #' @export 73 | #' @examples 74 | #' 75 | #' ggplot(airquality, aes(x = Day, y = Temp, 76 | #' group = as.factor(Month), color = as.factor(Month))) + 77 | #' geom_point(size = 2.5) + 78 | #' scale_colour_puppets() 79 | #' @importFrom ggplot2 discrete_scale scale_color_gradientn 80 | 81 | scale_colour_puppets <- scale_color_puppets 82 | 83 | #' @title scale_fill_puppets 84 | #' @rdname puppets_pal 85 | #' @export 86 | #' @examples 87 | #' 88 | #' ggplot(mpg, aes(displ)) + 89 | #' geom_histogram(aes(fill = class), 90 | #' col = "black", size = 0.1) + 91 | #' scale_fill_puppets() 92 | #' @importFrom ggplot2 discrete_scale scale_fill_gradientn 93 | 94 | scale_fill_puppets <- function(n, type = "discrete", 95 | reverse = FALSE, ...){ 96 | if (type == "discrete") { 97 | ggplot2::discrete_scale("fill", "puppets", 98 | puppets_pal(n = n, type = type, 99 | reverse = reverse), ...) 100 | } else { 101 | ggplot2::scale_fill_gradientn(colors = puppets_pal(n = n, type = type, 102 | reverse = reverse)(10)) 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /R/reload_palette.R: -------------------------------------------------------------------------------- 1 | reload_palette <- c("#000000", "#A8A8A8", "#AE0115", "#FFFFFF", "#FDC101", 2 | "#FD8900", "#808080", "#CF0010", "#FA4500", "#2D1219") 3 | 4 | #' @title reload palette 5 | #' @description reload palette 6 | #' @inheritDotParams ggplot2::discrete_scale 7 | #' @param n number of colors 8 | #' @param type discrete or continuous 9 | #' @param reverse reverse order, Default: FALSE 10 | #' @rdname reload_pal 11 | #' @examples 12 | #' library(scales) 13 | #' show_col(reload_pal()(10),labels = FALSE) 14 | #' @export 15 | #' @importFrom scales manual_pal 16 | #' @importFrom glue glue 17 | #' @importFrom grDevices colorRampPalette 18 | 19 | reload_pal <- function(n, type = c("discrete", "continuous"), 20 | reverse = FALSE){ 21 | reload <- reload_palette 22 | 23 | if (reverse == TRUE) { 24 | reload <- rev(reload) 25 | } 26 | 27 | if (missing(n)) { 28 | n <- length(reload) 29 | } 30 | 31 | type <- match.arg(type) 32 | 33 | if (type == "discrete" && n > length(reload)) { 34 | stop(glue::glue("Palette does not have {n} colors, maximum is {length(reload)}!")) 35 | } 36 | 37 | reload <- switch(type, 38 | continuous = grDevices::colorRampPalette(reload)(n), 39 | discrete = reload[1:n]) 40 | 41 | reload <- scales::manual_pal(reload) 42 | 43 | return(reload) 44 | } 45 | 46 | #' @title scale_color_reload 47 | #' @rdname reload_pal 48 | #' @export 49 | #' @examples 50 | #' 51 | #' library(ggplot2) 52 | #' ggplot(airquality, aes(x = Day, y = Temp, 53 | #' group = as.factor(Month), color = as.factor(Month))) + 54 | #' geom_point(size = 2.5) + 55 | #' scale_color_reload() 56 | #' @importFrom ggplot2 discrete_scale scale_color_gradientn 57 | 58 | scale_color_reload <- function(n, type = "discrete", 59 | reverse = FALSE, ...){ 60 | if (type == "discrete") { 61 | ggplot2::discrete_scale("color", "reload", 62 | reload_pal(n = n, type = type, 63 | reverse = reverse), ...) 64 | } else { 65 | ggplot2::scale_color_gradientn(colors = reload_pal(n = n, type = type, 66 | reverse = reverse)(8)) 67 | } 68 | } 69 | 70 | #' @title scale_colour_reload 71 | #' @rdname reload_pal 72 | #' @export 73 | #' @examples 74 | #' 75 | #' ggplot(airquality, aes(x = Day, y = Temp, 76 | #' group = as.factor(Month), color = as.factor(Month))) + 77 | #' geom_point(size = 2.5) + 78 | #' scale_colour_reload() 79 | #' @importFrom ggplot2 discrete_scale scale_color_gradientn 80 | 81 | scale_colour_reload <- scale_color_reload 82 | 83 | #' @title scale_fill_reload 84 | #' @rdname reload_pal 85 | #' @export 86 | #' @examples 87 | #' 88 | #' ggplot(mpg, aes(displ)) + 89 | #' geom_histogram(aes(fill = class), 90 | #' col = "black", size = 0.1) + 91 | #' scale_fill_reload() 92 | #' @importFrom ggplot2 discrete_scale scale_fill_gradientn 93 | 94 | scale_fill_reload <- function(n, type = "discrete", 95 | reverse = FALSE, ...){ 96 | if (type == "discrete") { 97 | ggplot2::discrete_scale("fill", "reload", 98 | reload_pal(n = n, type = type, 99 | reverse = reverse), ...) 100 | } else { 101 | ggplot2::scale_fill_gradientn(colors = reload_pal(n = n, type = type, 102 | reverse = reverse)(10)) 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /R/seasons_palette.R: -------------------------------------------------------------------------------- 1 | seasons_palette <- c("#fffba8", "#E8E690", "#ffff01", "#EDEA15", "#CDC6B3", 2 | "#888752", "#836800", "#b39c00", "#2A230F", "#000000") 3 | 4 | 5 | 6 | #' @title seasons palette 7 | #' @description seasons palette 8 | #' @inheritDotParams ggplot2::discrete_scale 9 | #' @param n number of colors 10 | #' @param type discrete or continuous 11 | #' @param reverse reverse order, Default: FALSE 12 | #' @rdname seasons_pal 13 | #' @examples 14 | #' library(scales) 15 | #' show_col(seasons_pal()(10),labels = FALSE) 16 | #' @export 17 | #' @importFrom scales manual_pal 18 | #' @importFrom glue glue 19 | #' @importFrom grDevices colorRampPalette 20 | 21 | seasons_pal <- function(n, type = c("discrete", "continuous"), 22 | reverse = FALSE){ 23 | seasons <- seasons_palette 24 | 25 | if (reverse == TRUE) { 26 | seasons <- rev(seasons) 27 | } 28 | 29 | if (missing(n)) { 30 | n <- length(seasons) 31 | } 32 | 33 | type <- match.arg(type) 34 | 35 | if (type == "discrete" && n > length(seasons)) { 36 | stop(glue::glue("Palette does not have {n} colors, maximum is {length(seasons)}!")) 37 | } 38 | 39 | seasons <- switch(type, 40 | continuous = grDevices::colorRampPalette(seasons)(n), 41 | discrete = seasons[1:n]) 42 | 43 | seasons <- scales::manual_pal(seasons) 44 | 45 | return(seasons) 46 | } 47 | 48 | #' @title scale_color_seasons 49 | #' @rdname seasons_pal 50 | #' @export 51 | #' @examples 52 | #' 53 | #' library(ggplot2) 54 | #' ggplot(airquality, aes(x = Day, y = Temp, 55 | #' group = as.factor(Month), color = as.factor(Month))) + 56 | #' geom_point(size = 2.5) + 57 | #' scale_color_seasons() 58 | #' @importFrom ggplot2 discrete_scale scale_color_gradientn 59 | 60 | scale_color_seasons <- function(n, type = "discrete", 61 | reverse = FALSE, ...){ 62 | if (type == "discrete") { 63 | ggplot2::discrete_scale("color", "seasons", 64 | seasons_pal(n = n, type = type, 65 | reverse = reverse), ...) 66 | } else { 67 | ggplot2::scale_color_gradientn(colors = seasons_pal(n = n, type = type, 68 | reverse = reverse)(8)) 69 | } 70 | } 71 | 72 | #' @title scale_colour_seasons 73 | #' @rdname seasons_pal 74 | #' @export 75 | #' @examples 76 | #' 77 | #' ggplot(airquality, aes(x = Day, y = Temp, 78 | #' group = as.factor(Month), color = as.factor(Month))) + 79 | #' geom_point(size = 2.5) + 80 | #' scale_colour_seasons() 81 | #' @importFrom ggplot2 discrete_scale scale_color_gradientn 82 | 83 | scale_colour_seasons <- scale_color_seasons 84 | 85 | #' @title scale_fill_seasons 86 | #' @rdname seasons_pal 87 | #' @export 88 | #' @examples 89 | #' 90 | #' ggplot(mpg, aes(displ)) + 91 | #' geom_histogram(aes(fill = class), 92 | #' col = "black", size = 0.1) + 93 | #' scale_fill_seasons() 94 | #' @importFrom ggplot2 discrete_scale scale_fill_gradientn 95 | 96 | scale_fill_seasons <- function(n, type = "discrete", 97 | reverse = FALSE, ...){ 98 | if (type == "discrete") { 99 | ggplot2::discrete_scale("fill", "seasons", 100 | seasons_pal(n = n, type = type, 101 | reverse = reverse), ...) 102 | } else { 103 | ggplot2::scale_fill_gradientn(colors = seasons_pal(n = n, type = type, 104 | reverse = reverse)(10)) 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /_pkgdown.yml: -------------------------------------------------------------------------------- 1 | template: 2 | params: 3 | bootswatch: slate 4 | -------------------------------------------------------------------------------- /docs/tmp.txt: -------------------------------------------------------------------------------- 1 | t -------------------------------------------------------------------------------- /man/anger_pal.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/anger_palette.R 3 | \name{anger_pal} 4 | \alias{anger_pal} 5 | \alias{scale_color_anger} 6 | \alias{scale_colour_anger} 7 | \alias{scale_fill_anger} 8 | \title{anger palette} 9 | \usage{ 10 | anger_pal(n, type = c("discrete", "continuous"), reverse = FALSE) 11 | 12 | scale_color_anger(n, type = "discrete", reverse = FALSE, ...) 13 | 14 | scale_colour_anger(n, type = "discrete", reverse = FALSE, ...) 15 | 16 | scale_fill_anger(n, type = "discrete", reverse = FALSE, ...) 17 | } 18 | \arguments{ 19 | \item{n}{number of colors} 20 | 21 | \item{type}{discrete or continuous} 22 | 23 | \item{reverse}{reverse order, Default: FALSE} 24 | 25 | \item{...}{ 26 | Arguments passed on to \code{\link[ggplot2:discrete_scale]{ggplot2::discrete_scale}} 27 | \describe{ 28 | \item{\code{aesthetics}}{The names of the aesthetics that this scale works with.} 29 | \item{\code{scale_name}}{The name of the scale that should be used for error messages 30 | associated with this scale.} 31 | \item{\code{palette}}{A palette function that when called with a single integer 32 | argument (the number of levels in the scale) returns the values that 33 | they should take (e.g., \code{\link[scales:hue_pal]{scales::hue_pal()}}).} 34 | \item{\code{name}}{The name of the scale. Used as the axis or legend title. If 35 | \code{waiver()}, the default, the name of the scale is taken from the first 36 | mapping used for that aesthetic. If \code{NULL}, the legend title will be 37 | omitted.} 38 | \item{\code{breaks}}{One of: 39 | \itemize{ 40 | \item \code{NULL} for no breaks 41 | \item \code{waiver()} for the default breaks (the scale limits) 42 | \item A character vector of breaks 43 | \item A function that takes the limits as input and returns breaks 44 | as output. Also accepts rlang \link[rlang:as_function]{lambda} function 45 | notation. 46 | }} 47 | \item{\code{labels}}{One of: 48 | \itemize{ 49 | \item \code{NULL} for no labels 50 | \item \code{waiver()} for the default labels computed by the 51 | transformation object 52 | \item A character vector giving labels (must be same length as \code{breaks}) 53 | \item An expression vector (must be the same length as breaks). See ?plotmath for details. 54 | \item A function that takes the breaks as input and returns labels 55 | as output. Also accepts rlang \link[rlang:as_function]{lambda} function 56 | notation. 57 | }} 58 | \item{\code{limits}}{One of: 59 | \itemize{ 60 | \item \code{NULL} to use the default scale values 61 | \item A character vector that defines possible values of the scale and their 62 | order 63 | \item A function that accepts the existing (automatic) values and returns 64 | new ones. Also accepts rlang \link[rlang:as_function]{lambda} function 65 | notation. 66 | }} 67 | \item{\code{expand}}{For position scales, a vector of range expansion constants used to add some 68 | padding around the data to ensure that they are placed some distance 69 | away from the axes. Use the convenience function \code{\link[ggplot2:expansion]{expansion()}} 70 | to generate the values for the \code{expand} argument. The defaults are to 71 | expand the scale by 5\% on each side for continuous variables, and by 72 | 0.6 units on each side for discrete variables.} 73 | \item{\code{na.translate}}{Unlike continuous scales, discrete scales can easily show 74 | missing values, and do so by default. If you want to remove missing values 75 | from a discrete scale, specify \code{na.translate = FALSE}.} 76 | \item{\code{na.value}}{If \code{na.translate = TRUE}, what aesthetic value should the 77 | missing values be displayed as? Does not apply to position scales 78 | where \code{NA} is always placed at the far right.} 79 | \item{\code{drop}}{Should unused factor levels be omitted from the scale? 80 | The default, \code{TRUE}, uses the levels that appear in the data; 81 | \code{FALSE} uses all the levels in the factor.} 82 | \item{\code{guide}}{A function used to create a guide or its name. See 83 | \code{\link[ggplot2:guides]{guides()}} for more information.} 84 | \item{\code{position}}{For position scales, The position of the axis. 85 | \code{left} or \code{right} for y axes, \code{top} or \code{bottom} for x axes.} 86 | \item{\code{super}}{The super class to use for the constructed scale} 87 | }} 88 | } 89 | \description{ 90 | anger palette 91 | } 92 | \examples{ 93 | library(scales) 94 | show_col(anger_pal()(10),labels = FALSE) 95 | 96 | library(ggplot2) 97 | ggplot(airquality, aes(x = Day, y = Temp, 98 | group = as.factor(Month), color = as.factor(Month))) + 99 | geom_point(size = 2.5) + 100 | scale_color_anger() 101 | 102 | ggplot(airquality, aes(x = Day, y = Temp, 103 | group = as.factor(Month), color = as.factor(Month))) + 104 | geom_point(size = 2.5) + 105 | scale_colour_anger() 106 | 107 | ggplot(mpg, aes(displ)) + 108 | geom_histogram(aes(fill = class), 109 | col = "black", size = 0.1) + 110 | scale_fill_anger() 111 | } 112 | -------------------------------------------------------------------------------- /man/combo_pal.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/combo_palette.R 3 | \name{combo_pal} 4 | \alias{combo_pal} 5 | \alias{scale_color_combo} 6 | \alias{scale_colour_combo} 7 | \alias{scale_fill_combo} 8 | \title{combo palette} 9 | \usage{ 10 | combo_pal(n, type = c("discrete", "continuous"), reverse = FALSE) 11 | 12 | scale_color_combo(n, type = "discrete", reverse = FALSE, ...) 13 | 14 | scale_colour_combo(n, type = "discrete", reverse = FALSE, ...) 15 | 16 | scale_fill_combo(n, type = "discrete", reverse = FALSE, ...) 17 | } 18 | \arguments{ 19 | \item{n}{number of colors} 20 | 21 | \item{type}{discrete or continuous} 22 | 23 | \item{reverse}{reverse order, Default: FALSE} 24 | 25 | \item{...}{ 26 | Arguments passed on to \code{\link[ggplot2:discrete_scale]{ggplot2::discrete_scale}} 27 | \describe{ 28 | \item{\code{aesthetics}}{The names of the aesthetics that this scale works with.} 29 | \item{\code{scale_name}}{The name of the scale that should be used for error messages 30 | associated with this scale.} 31 | \item{\code{palette}}{A palette function that when called with a single integer 32 | argument (the number of levels in the scale) returns the values that 33 | they should take (e.g., \code{\link[scales:hue_pal]{scales::hue_pal()}}).} 34 | \item{\code{name}}{The name of the scale. Used as the axis or legend title. If 35 | \code{waiver()}, the default, the name of the scale is taken from the first 36 | mapping used for that aesthetic. If \code{NULL}, the legend title will be 37 | omitted.} 38 | \item{\code{breaks}}{One of: 39 | \itemize{ 40 | \item \code{NULL} for no breaks 41 | \item \code{waiver()} for the default breaks (the scale limits) 42 | \item A character vector of breaks 43 | \item A function that takes the limits as input and returns breaks 44 | as output. Also accepts rlang \link[rlang:as_function]{lambda} function 45 | notation. 46 | }} 47 | \item{\code{labels}}{One of: 48 | \itemize{ 49 | \item \code{NULL} for no labels 50 | \item \code{waiver()} for the default labels computed by the 51 | transformation object 52 | \item A character vector giving labels (must be same length as \code{breaks}) 53 | \item An expression vector (must be the same length as breaks). See ?plotmath for details. 54 | \item A function that takes the breaks as input and returns labels 55 | as output. Also accepts rlang \link[rlang:as_function]{lambda} function 56 | notation. 57 | }} 58 | \item{\code{limits}}{One of: 59 | \itemize{ 60 | \item \code{NULL} to use the default scale values 61 | \item A character vector that defines possible values of the scale and their 62 | order 63 | \item A function that accepts the existing (automatic) values and returns 64 | new ones. Also accepts rlang \link[rlang:as_function]{lambda} function 65 | notation. 66 | }} 67 | \item{\code{expand}}{For position scales, a vector of range expansion constants used to add some 68 | padding around the data to ensure that they are placed some distance 69 | away from the axes. Use the convenience function \code{\link[ggplot2:expansion]{expansion()}} 70 | to generate the values for the \code{expand} argument. The defaults are to 71 | expand the scale by 5\% on each side for continuous variables, and by 72 | 0.6 units on each side for discrete variables.} 73 | \item{\code{na.translate}}{Unlike continuous scales, discrete scales can easily show 74 | missing values, and do so by default. If you want to remove missing values 75 | from a discrete scale, specify \code{na.translate = FALSE}.} 76 | \item{\code{na.value}}{If \code{na.translate = TRUE}, what aesthetic value should the 77 | missing values be displayed as? Does not apply to position scales 78 | where \code{NA} is always placed at the far right.} 79 | \item{\code{drop}}{Should unused factor levels be omitted from the scale? 80 | The default, \code{TRUE}, uses the levels that appear in the data; 81 | \code{FALSE} uses all the levels in the factor.} 82 | \item{\code{guide}}{A function used to create a guide or its name. See 83 | \code{\link[ggplot2:guides]{guides()}} for more information.} 84 | \item{\code{position}}{For position scales, The position of the axis. 85 | \code{left} or \code{right} for y axes, \code{top} or \code{bottom} for x axes.} 86 | \item{\code{super}}{The super class to use for the constructed scale} 87 | }} 88 | } 89 | \description{ 90 | combo palette 91 | } 92 | \examples{ 93 | library(scales) 94 | show_col(combo_pal()(10),,labels = FALSE) 95 | 96 | library(ggplot2) 97 | ggplot(airquality, aes(x = Day, y = Temp, 98 | group = as.factor(Month), color = as.factor(Month))) + 99 | geom_point(size = 2.5) + 100 | scale_color_combo() 101 | 102 | ggplot(airquality, aes(x = Day, y = Temp, 103 | group = as.factor(Month), color = as.factor(Month))) + 104 | geom_point(size = 2.5) + 105 | scale_colour_combo() 106 | 107 | ggplot(mpg, aes(displ)) + 108 | geom_histogram(aes(fill = class), 109 | col = "black", size = 0.1) + 110 | scale_fill_combo() 111 | } 112 | -------------------------------------------------------------------------------- /man/figures/README-ajfa-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnmackintosh/metallicaRt/c36fa0ef2d930660f6c0400537433c2df473be88/man/figures/README-ajfa-1.png -------------------------------------------------------------------------------- /man/figures/README-ajfa-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnmackintosh/metallicaRt/c36fa0ef2d930660f6c0400537433c2df473be88/man/figures/README-ajfa-2.png -------------------------------------------------------------------------------- /man/figures/README-combo-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnmackintosh/metallicaRt/c36fa0ef2d930660f6c0400537433c2df473be88/man/figures/README-combo-1.png -------------------------------------------------------------------------------- /man/figures/README-destruct-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnmackintosh/metallicaRt/c36fa0ef2d930660f6c0400537433c2df473be88/man/figures/README-destruct-1.png -------------------------------------------------------------------------------- /man/figures/README-destruct-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnmackintosh/metallicaRt/c36fa0ef2d930660f6c0400537433c2df473be88/man/figures/README-destruct-2.png -------------------------------------------------------------------------------- /man/figures/README-first4-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnmackintosh/metallicaRt/c36fa0ef2d930660f6c0400537433c2df473be88/man/figures/README-first4-1.png -------------------------------------------------------------------------------- /man/figures/README-first4-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnmackintosh/metallicaRt/c36fa0ef2d930660f6c0400537433c2df473be88/man/figures/README-first4-2.png -------------------------------------------------------------------------------- /man/figures/README-first4-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnmackintosh/metallicaRt/c36fa0ef2d930660f6c0400537433c2df473be88/man/figures/README-first4-3.png -------------------------------------------------------------------------------- /man/figures/README-first4-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnmackintosh/metallicaRt/c36fa0ef2d930660f6c0400537433c2df473be88/man/figures/README-first4-4.png -------------------------------------------------------------------------------- /man/figures/README-frantic-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnmackintosh/metallicaRt/c36fa0ef2d930660f6c0400537433c2df473be88/man/figures/README-frantic-1.png -------------------------------------------------------------------------------- /man/figures/README-frantic-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnmackintosh/metallicaRt/c36fa0ef2d930660f6c0400537433c2df473be88/man/figures/README-frantic-2.png -------------------------------------------------------------------------------- /man/figures/README-frantic-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnmackintosh/metallicaRt/c36fa0ef2d930660f6c0400537433c2df473be88/man/figures/README-frantic-3.png -------------------------------------------------------------------------------- /man/figures/README-frantic-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnmackintosh/metallicaRt/c36fa0ef2d930660f6c0400537433c2df473be88/man/figures/README-frantic-4.png -------------------------------------------------------------------------------- /man/figures/README-kill-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnmackintosh/metallicaRt/c36fa0ef2d930660f6c0400537433c2df473be88/man/figures/README-kill-1.png -------------------------------------------------------------------------------- /man/figures/README-kill-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnmackintosh/metallicaRt/c36fa0ef2d930660f6c0400537433c2df473be88/man/figures/README-kill-2.png -------------------------------------------------------------------------------- /man/figures/README-load-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnmackintosh/metallicaRt/c36fa0ef2d930660f6c0400537433c2df473be88/man/figures/README-load-1.png -------------------------------------------------------------------------------- /man/figures/README-load-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnmackintosh/metallicaRt/c36fa0ef2d930660f6c0400537433c2df473be88/man/figures/README-load-2.png -------------------------------------------------------------------------------- /man/figures/README-magnetic-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnmackintosh/metallicaRt/c36fa0ef2d930660f6c0400537433c2df473be88/man/figures/README-magnetic-1.png -------------------------------------------------------------------------------- /man/figures/README-magnetic-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnmackintosh/metallicaRt/c36fa0ef2d930660f6c0400537433c2df473be88/man/figures/README-magnetic-2.png -------------------------------------------------------------------------------- /man/figures/README-metallica-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnmackintosh/metallicaRt/c36fa0ef2d930660f6c0400537433c2df473be88/man/figures/README-metallica-1.png -------------------------------------------------------------------------------- /man/figures/README-metallica-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnmackintosh/metallicaRt/c36fa0ef2d930660f6c0400537433c2df473be88/man/figures/README-metallica-2.png -------------------------------------------------------------------------------- /man/figures/README-mop-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnmackintosh/metallicaRt/c36fa0ef2d930660f6c0400537433c2df473be88/man/figures/README-mop-1.png -------------------------------------------------------------------------------- /man/figures/README-mop-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnmackintosh/metallicaRt/c36fa0ef2d930660f6c0400537433c2df473be88/man/figures/README-mop-2.png -------------------------------------------------------------------------------- /man/figures/README-reload-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnmackintosh/metallicaRt/c36fa0ef2d930660f6c0400537433c2df473be88/man/figures/README-reload-1.png -------------------------------------------------------------------------------- /man/figures/README-reload-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnmackintosh/metallicaRt/c36fa0ef2d930660f6c0400537433c2df473be88/man/figures/README-reload-2.png -------------------------------------------------------------------------------- /man/figures/README-roam-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnmackintosh/metallicaRt/c36fa0ef2d930660f6c0400537433c2df473be88/man/figures/README-roam-1.png -------------------------------------------------------------------------------- /man/figures/README-roam-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnmackintosh/metallicaRt/c36fa0ef2d930660f6c0400537433c2df473be88/man/figures/README-roam-2.png -------------------------------------------------------------------------------- /man/figures/README-roam-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnmackintosh/metallicaRt/c36fa0ef2d930660f6c0400537433c2df473be88/man/figures/README-roam-3.png -------------------------------------------------------------------------------- /man/figures/README-rtl-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnmackintosh/metallicaRt/c36fa0ef2d930660f6c0400537433c2df473be88/man/figures/README-rtl-1.png -------------------------------------------------------------------------------- /man/figures/README-rtl-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnmackintosh/metallicaRt/c36fa0ef2d930660f6c0400537433c2df473be88/man/figures/README-rtl-2.png -------------------------------------------------------------------------------- /man/figures/README-seasons-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnmackintosh/metallicaRt/c36fa0ef2d930660f6c0400537433c2df473be88/man/figures/README-seasons-1.png -------------------------------------------------------------------------------- /man/figures/README-seasons-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnmackintosh/metallicaRt/c36fa0ef2d930660f6c0400537433c2df473be88/man/figures/README-seasons-2.png -------------------------------------------------------------------------------- /man/figures/README-stanger-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnmackintosh/metallicaRt/c36fa0ef2d930660f6c0400537433c2df473be88/man/figures/README-stanger-1.png -------------------------------------------------------------------------------- /man/figures/README-stanger-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnmackintosh/metallicaRt/c36fa0ef2d930660f6c0400537433c2df473be88/man/figures/README-stanger-2.png -------------------------------------------------------------------------------- /man/figures/metallicart.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnmackintosh/metallicaRt/c36fa0ef2d930660f6c0400537433c2df473be88/man/figures/metallicart.jpg -------------------------------------------------------------------------------- /man/figures/metallicart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnmackintosh/metallicaRt/c36fa0ef2d930660f6c0400537433c2df473be88/man/figures/metallicart.png -------------------------------------------------------------------------------- /man/hardwired_pal.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/hardwired_palette.R 3 | \name{hardwired_pal} 4 | \alias{hardwired_pal} 5 | \alias{scale_color_hardwired} 6 | \alias{scale_colour_hardwired} 7 | \alias{scale_fill_hardwired} 8 | \title{hardwired palette} 9 | \usage{ 10 | hardwired_pal(n, type = c("discrete", "continuous"), reverse = FALSE) 11 | 12 | scale_color_hardwired(n, type = "discrete", reverse = FALSE, ...) 13 | 14 | scale_colour_hardwired(n, type = "discrete", reverse = FALSE, ...) 15 | 16 | scale_fill_hardwired(n, type = "discrete", reverse = FALSE, ...) 17 | } 18 | \arguments{ 19 | \item{n}{number of colors} 20 | 21 | \item{type}{discrete or continuous} 22 | 23 | \item{reverse}{reverse order, Default: FALSE} 24 | 25 | \item{...}{ 26 | Arguments passed on to \code{\link[ggplot2:discrete_scale]{ggplot2::discrete_scale}} 27 | \describe{ 28 | \item{\code{aesthetics}}{The names of the aesthetics that this scale works with.} 29 | \item{\code{scale_name}}{The name of the scale that should be used for error messages 30 | associated with this scale.} 31 | \item{\code{palette}}{A palette function that when called with a single integer 32 | argument (the number of levels in the scale) returns the values that 33 | they should take (e.g., \code{\link[scales:hue_pal]{scales::hue_pal()}}).} 34 | \item{\code{name}}{The name of the scale. Used as the axis or legend title. If 35 | \code{waiver()}, the default, the name of the scale is taken from the first 36 | mapping used for that aesthetic. If \code{NULL}, the legend title will be 37 | omitted.} 38 | \item{\code{breaks}}{One of: 39 | \itemize{ 40 | \item \code{NULL} for no breaks 41 | \item \code{waiver()} for the default breaks (the scale limits) 42 | \item A character vector of breaks 43 | \item A function that takes the limits as input and returns breaks 44 | as output. Also accepts rlang \link[rlang:as_function]{lambda} function 45 | notation. 46 | }} 47 | \item{\code{labels}}{One of: 48 | \itemize{ 49 | \item \code{NULL} for no labels 50 | \item \code{waiver()} for the default labels computed by the 51 | transformation object 52 | \item A character vector giving labels (must be same length as \code{breaks}) 53 | \item An expression vector (must be the same length as breaks). See ?plotmath for details. 54 | \item A function that takes the breaks as input and returns labels 55 | as output. Also accepts rlang \link[rlang:as_function]{lambda} function 56 | notation. 57 | }} 58 | \item{\code{limits}}{One of: 59 | \itemize{ 60 | \item \code{NULL} to use the default scale values 61 | \item A character vector that defines possible values of the scale and their 62 | order 63 | \item A function that accepts the existing (automatic) values and returns 64 | new ones. Also accepts rlang \link[rlang:as_function]{lambda} function 65 | notation. 66 | }} 67 | \item{\code{expand}}{For position scales, a vector of range expansion constants used to add some 68 | padding around the data to ensure that they are placed some distance 69 | away from the axes. Use the convenience function \code{\link[ggplot2:expansion]{expansion()}} 70 | to generate the values for the \code{expand} argument. The defaults are to 71 | expand the scale by 5\% on each side for continuous variables, and by 72 | 0.6 units on each side for discrete variables.} 73 | \item{\code{na.translate}}{Unlike continuous scales, discrete scales can easily show 74 | missing values, and do so by default. If you want to remove missing values 75 | from a discrete scale, specify \code{na.translate = FALSE}.} 76 | \item{\code{na.value}}{If \code{na.translate = TRUE}, what aesthetic value should the 77 | missing values be displayed as? Does not apply to position scales 78 | where \code{NA} is always placed at the far right.} 79 | \item{\code{drop}}{Should unused factor levels be omitted from the scale? 80 | The default, \code{TRUE}, uses the levels that appear in the data; 81 | \code{FALSE} uses all the levels in the factor.} 82 | \item{\code{guide}}{A function used to create a guide or its name. See 83 | \code{\link[ggplot2:guides]{guides()}} for more information.} 84 | \item{\code{position}}{For position scales, The position of the axis. 85 | \code{left} or \code{right} for y axes, \code{top} or \code{bottom} for x axes.} 86 | \item{\code{super}}{The super class to use for the constructed scale} 87 | }} 88 | } 89 | \description{ 90 | hardwired palette 91 | } 92 | \examples{ 93 | library(scales) 94 | show_col(hardwired_pal()(10),labels = FALSE) 95 | 96 | library(ggplot2) 97 | ggplot(airquality, aes(x = Day, y = Temp, 98 | group = as.factor(Month), color = as.factor(Month))) + 99 | geom_point(size = 2.5) + 100 | scale_color_hardwired() 101 | 102 | ggplot(airquality, aes(x = Day, y = Temp, 103 | group = as.factor(Month), color = as.factor(Month))) + 104 | geom_point(size = 2.5) + 105 | scale_colour_hardwired() 106 | 107 | ggplot(mpg, aes(displ)) + 108 | geom_histogram(aes(fill = class), 109 | col = "black", size = 0.1) + 110 | scale_fill_hardwired() 111 | } 112 | -------------------------------------------------------------------------------- /man/justice_pal.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/justice_palette.R 3 | \name{justice_pal} 4 | \alias{justice_pal} 5 | \alias{scale_color_justice} 6 | \alias{scale_colour_justice} 7 | \alias{scale_fill_justice} 8 | \title{justice palette} 9 | \usage{ 10 | justice_pal(n, type = c("discrete", "continuous"), reverse = FALSE) 11 | 12 | scale_color_justice(n, type = "discrete", reverse = FALSE, ...) 13 | 14 | scale_colour_justice(n, type = "discrete", reverse = FALSE, ...) 15 | 16 | scale_fill_justice(n, type = "discrete", reverse = FALSE, ...) 17 | } 18 | \arguments{ 19 | \item{n}{number of colors} 20 | 21 | \item{type}{discrete or continuous} 22 | 23 | \item{reverse}{reverse order, Default: FALSE} 24 | 25 | \item{...}{ 26 | Arguments passed on to \code{\link[ggplot2:discrete_scale]{ggplot2::discrete_scale}} 27 | \describe{ 28 | \item{\code{aesthetics}}{The names of the aesthetics that this scale works with.} 29 | \item{\code{scale_name}}{The name of the scale that should be used for error messages 30 | associated with this scale.} 31 | \item{\code{palette}}{A palette function that when called with a single integer 32 | argument (the number of levels in the scale) returns the values that 33 | they should take (e.g., \code{\link[scales:hue_pal]{scales::hue_pal()}}).} 34 | \item{\code{name}}{The name of the scale. Used as the axis or legend title. If 35 | \code{waiver()}, the default, the name of the scale is taken from the first 36 | mapping used for that aesthetic. If \code{NULL}, the legend title will be 37 | omitted.} 38 | \item{\code{breaks}}{One of: 39 | \itemize{ 40 | \item \code{NULL} for no breaks 41 | \item \code{waiver()} for the default breaks (the scale limits) 42 | \item A character vector of breaks 43 | \item A function that takes the limits as input and returns breaks 44 | as output. Also accepts rlang \link[rlang:as_function]{lambda} function 45 | notation. 46 | }} 47 | \item{\code{labels}}{One of: 48 | \itemize{ 49 | \item \code{NULL} for no labels 50 | \item \code{waiver()} for the default labels computed by the 51 | transformation object 52 | \item A character vector giving labels (must be same length as \code{breaks}) 53 | \item An expression vector (must be the same length as breaks). See ?plotmath for details. 54 | \item A function that takes the breaks as input and returns labels 55 | as output. Also accepts rlang \link[rlang:as_function]{lambda} function 56 | notation. 57 | }} 58 | \item{\code{limits}}{One of: 59 | \itemize{ 60 | \item \code{NULL} to use the default scale values 61 | \item A character vector that defines possible values of the scale and their 62 | order 63 | \item A function that accepts the existing (automatic) values and returns 64 | new ones. Also accepts rlang \link[rlang:as_function]{lambda} function 65 | notation. 66 | }} 67 | \item{\code{expand}}{For position scales, a vector of range expansion constants used to add some 68 | padding around the data to ensure that they are placed some distance 69 | away from the axes. Use the convenience function \code{\link[ggplot2:expansion]{expansion()}} 70 | to generate the values for the \code{expand} argument. The defaults are to 71 | expand the scale by 5\% on each side for continuous variables, and by 72 | 0.6 units on each side for discrete variables.} 73 | \item{\code{na.translate}}{Unlike continuous scales, discrete scales can easily show 74 | missing values, and do so by default. If you want to remove missing values 75 | from a discrete scale, specify \code{na.translate = FALSE}.} 76 | \item{\code{na.value}}{If \code{na.translate = TRUE}, what aesthetic value should the 77 | missing values be displayed as? Does not apply to position scales 78 | where \code{NA} is always placed at the far right.} 79 | \item{\code{drop}}{Should unused factor levels be omitted from the scale? 80 | The default, \code{TRUE}, uses the levels that appear in the data; 81 | \code{FALSE} uses all the levels in the factor.} 82 | \item{\code{guide}}{A function used to create a guide or its name. See 83 | \code{\link[ggplot2:guides]{guides()}} for more information.} 84 | \item{\code{position}}{For position scales, The position of the axis. 85 | \code{left} or \code{right} for y axes, \code{top} or \code{bottom} for x axes.} 86 | \item{\code{super}}{The super class to use for the constructed scale} 87 | }} 88 | } 89 | \description{ 90 | justice palette 91 | } 92 | \examples{ 93 | library(scales) 94 | show_col(justice_pal()(10),labels = FALSE) 95 | 96 | library(ggplot2) 97 | ggplot(airquality, aes(x = Day, y = Temp, 98 | group = as.factor(Month), color = as.factor(Month))) + 99 | geom_point(size = 2.5) + 100 | scale_color_justice() 101 | 102 | ggplot(airquality, aes(x = Day, y = Temp, 103 | group = as.factor(Month), color = as.factor(Month))) + 104 | geom_point(size = 2.5) + 105 | scale_colour_justice() 106 | 107 | ggplot(mpg, aes(displ)) + 108 | geom_histogram(aes(fill = class), 109 | col = "black", size = 0.1) + 110 | scale_fill_justice() 111 | } 112 | -------------------------------------------------------------------------------- /man/killem_pal.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/killem_palette.R 3 | \name{killem_pal} 4 | \alias{killem_pal} 5 | \alias{scale_color_killem} 6 | \alias{scale_colour_killem} 7 | \alias{scale_fill_killem} 8 | \title{killem palette} 9 | \usage{ 10 | killem_pal(n, type = c("discrete", "continuous"), reverse = FALSE) 11 | 12 | scale_color_killem(n, type = "discrete", reverse = FALSE, ...) 13 | 14 | scale_colour_killem(n, type = "discrete", reverse = FALSE, ...) 15 | 16 | scale_fill_killem(n, type = "discrete", reverse = FALSE, ...) 17 | } 18 | \arguments{ 19 | \item{n}{number of colors} 20 | 21 | \item{type}{discrete or continuous} 22 | 23 | \item{reverse}{reverse order, Default: FALSE} 24 | 25 | \item{...}{ 26 | Arguments passed on to \code{\link[ggplot2:discrete_scale]{ggplot2::discrete_scale}} 27 | \describe{ 28 | \item{\code{aesthetics}}{The names of the aesthetics that this scale works with.} 29 | \item{\code{scale_name}}{The name of the scale that should be used for error messages 30 | associated with this scale.} 31 | \item{\code{palette}}{A palette function that when called with a single integer 32 | argument (the number of levels in the scale) returns the values that 33 | they should take (e.g., \code{\link[scales:hue_pal]{scales::hue_pal()}}).} 34 | \item{\code{name}}{The name of the scale. Used as the axis or legend title. If 35 | \code{waiver()}, the default, the name of the scale is taken from the first 36 | mapping used for that aesthetic. If \code{NULL}, the legend title will be 37 | omitted.} 38 | \item{\code{breaks}}{One of: 39 | \itemize{ 40 | \item \code{NULL} for no breaks 41 | \item \code{waiver()} for the default breaks (the scale limits) 42 | \item A character vector of breaks 43 | \item A function that takes the limits as input and returns breaks 44 | as output. Also accepts rlang \link[rlang:as_function]{lambda} function 45 | notation. 46 | }} 47 | \item{\code{labels}}{One of: 48 | \itemize{ 49 | \item \code{NULL} for no labels 50 | \item \code{waiver()} for the default labels computed by the 51 | transformation object 52 | \item A character vector giving labels (must be same length as \code{breaks}) 53 | \item An expression vector (must be the same length as breaks). See ?plotmath for details. 54 | \item A function that takes the breaks as input and returns labels 55 | as output. Also accepts rlang \link[rlang:as_function]{lambda} function 56 | notation. 57 | }} 58 | \item{\code{limits}}{One of: 59 | \itemize{ 60 | \item \code{NULL} to use the default scale values 61 | \item A character vector that defines possible values of the scale and their 62 | order 63 | \item A function that accepts the existing (automatic) values and returns 64 | new ones. Also accepts rlang \link[rlang:as_function]{lambda} function 65 | notation. 66 | }} 67 | \item{\code{expand}}{For position scales, a vector of range expansion constants used to add some 68 | padding around the data to ensure that they are placed some distance 69 | away from the axes. Use the convenience function \code{\link[ggplot2:expansion]{expansion()}} 70 | to generate the values for the \code{expand} argument. The defaults are to 71 | expand the scale by 5\% on each side for continuous variables, and by 72 | 0.6 units on each side for discrete variables.} 73 | \item{\code{na.translate}}{Unlike continuous scales, discrete scales can easily show 74 | missing values, and do so by default. If you want to remove missing values 75 | from a discrete scale, specify \code{na.translate = FALSE}.} 76 | \item{\code{na.value}}{If \code{na.translate = TRUE}, what aesthetic value should the 77 | missing values be displayed as? Does not apply to position scales 78 | where \code{NA} is always placed at the far right.} 79 | \item{\code{drop}}{Should unused factor levels be omitted from the scale? 80 | The default, \code{TRUE}, uses the levels that appear in the data; 81 | \code{FALSE} uses all the levels in the factor.} 82 | \item{\code{guide}}{A function used to create a guide or its name. See 83 | \code{\link[ggplot2:guides]{guides()}} for more information.} 84 | \item{\code{position}}{For position scales, The position of the axis. 85 | \code{left} or \code{right} for y axes, \code{top} or \code{bottom} for x axes.} 86 | \item{\code{super}}{The super class to use for the constructed scale} 87 | }} 88 | } 89 | \description{ 90 | killem palette 91 | } 92 | \examples{ 93 | library(scales) 94 | show_col(killem_pal()(10),labels = FALSE) 95 | 96 | library(ggplot2) 97 | ggplot(airquality, aes(x = Day, y = Temp, 98 | group = as.factor(Month), color = as.factor(Month))) + 99 | geom_point(size = 2.5) + 100 | scale_color_killem() 101 | 102 | ggplot(airquality, aes(x = Day, y = Temp, 103 | group = as.factor(Month), color = as.factor(Month))) + 104 | geom_point(size = 2.5) + 105 | scale_colour_killem() 106 | 107 | ggplot(mpg, aes(displ)) + 108 | geom_histogram(aes(fill = class), 109 | col = "black", size = 0.1) + 110 | scale_fill_killem() 111 | } 112 | -------------------------------------------------------------------------------- /man/lightning_pal.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/lightning_palette.R 3 | \name{lightning_pal} 4 | \alias{lightning_pal} 5 | \alias{scale_color_lightning} 6 | \alias{scale_colour_lightning} 7 | \alias{scale_fill_lightning} 8 | \title{lightning palette} 9 | \usage{ 10 | lightning_pal(n, type = c("discrete", "continuous"), reverse = FALSE) 11 | 12 | scale_color_lightning(n, type = "discrete", reverse = FALSE, ...) 13 | 14 | scale_colour_lightning(n, type = "discrete", reverse = FALSE, ...) 15 | 16 | scale_fill_lightning(n, type = "discrete", reverse = FALSE, ...) 17 | } 18 | \arguments{ 19 | \item{n}{number of colors} 20 | 21 | \item{type}{discrete or continuous} 22 | 23 | \item{reverse}{reverse order, Default: FALSE} 24 | 25 | \item{...}{ 26 | Arguments passed on to \code{\link[ggplot2:discrete_scale]{ggplot2::discrete_scale}} 27 | \describe{ 28 | \item{\code{aesthetics}}{The names of the aesthetics that this scale works with.} 29 | \item{\code{scale_name}}{The name of the scale that should be used for error messages 30 | associated with this scale.} 31 | \item{\code{palette}}{A palette function that when called with a single integer 32 | argument (the number of levels in the scale) returns the values that 33 | they should take (e.g., \code{\link[scales:hue_pal]{scales::hue_pal()}}).} 34 | \item{\code{name}}{The name of the scale. Used as the axis or legend title. If 35 | \code{waiver()}, the default, the name of the scale is taken from the first 36 | mapping used for that aesthetic. If \code{NULL}, the legend title will be 37 | omitted.} 38 | \item{\code{breaks}}{One of: 39 | \itemize{ 40 | \item \code{NULL} for no breaks 41 | \item \code{waiver()} for the default breaks (the scale limits) 42 | \item A character vector of breaks 43 | \item A function that takes the limits as input and returns breaks 44 | as output. Also accepts rlang \link[rlang:as_function]{lambda} function 45 | notation. 46 | }} 47 | \item{\code{labels}}{One of: 48 | \itemize{ 49 | \item \code{NULL} for no labels 50 | \item \code{waiver()} for the default labels computed by the 51 | transformation object 52 | \item A character vector giving labels (must be same length as \code{breaks}) 53 | \item An expression vector (must be the same length as breaks). See ?plotmath for details. 54 | \item A function that takes the breaks as input and returns labels 55 | as output. Also accepts rlang \link[rlang:as_function]{lambda} function 56 | notation. 57 | }} 58 | \item{\code{limits}}{One of: 59 | \itemize{ 60 | \item \code{NULL} to use the default scale values 61 | \item A character vector that defines possible values of the scale and their 62 | order 63 | \item A function that accepts the existing (automatic) values and returns 64 | new ones. Also accepts rlang \link[rlang:as_function]{lambda} function 65 | notation. 66 | }} 67 | \item{\code{expand}}{For position scales, a vector of range expansion constants used to add some 68 | padding around the data to ensure that they are placed some distance 69 | away from the axes. Use the convenience function \code{\link[ggplot2:expansion]{expansion()}} 70 | to generate the values for the \code{expand} argument. The defaults are to 71 | expand the scale by 5\% on each side for continuous variables, and by 72 | 0.6 units on each side for discrete variables.} 73 | \item{\code{na.translate}}{Unlike continuous scales, discrete scales can easily show 74 | missing values, and do so by default. If you want to remove missing values 75 | from a discrete scale, specify \code{na.translate = FALSE}.} 76 | \item{\code{na.value}}{If \code{na.translate = TRUE}, what aesthetic value should the 77 | missing values be displayed as? Does not apply to position scales 78 | where \code{NA} is always placed at the far right.} 79 | \item{\code{drop}}{Should unused factor levels be omitted from the scale? 80 | The default, \code{TRUE}, uses the levels that appear in the data; 81 | \code{FALSE} uses all the levels in the factor.} 82 | \item{\code{guide}}{A function used to create a guide or its name. See 83 | \code{\link[ggplot2:guides]{guides()}} for more information.} 84 | \item{\code{position}}{For position scales, The position of the axis. 85 | \code{left} or \code{right} for y axes, \code{top} or \code{bottom} for x axes.} 86 | \item{\code{super}}{The super class to use for the constructed scale} 87 | }} 88 | } 89 | \description{ 90 | lightning palette 91 | } 92 | \examples{ 93 | library(scales) 94 | show_col(lightning_pal()(10),labels = FALSE) 95 | 96 | library(ggplot2) 97 | ggplot(airquality, aes(x = Day, y = Temp, 98 | group = as.factor(Month), color = as.factor(Month))) + 99 | geom_point(size = 2.5) + 100 | scale_color_lightning() 101 | 102 | ggplot(airquality, aes(x = Day, y = Temp, 103 | group = as.factor(Month), color = as.factor(Month))) + 104 | geom_point(size = 2.5) + 105 | scale_colour_lightning() 106 | 107 | ggplot(mpg, aes(displ)) + 108 | geom_histogram(aes(fill = class), 109 | col = "black", size = 0.1) + 110 | scale_fill_lightning() 111 | } 112 | -------------------------------------------------------------------------------- /man/load_pal.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/load_palette.R 3 | \name{load_pal} 4 | \alias{load_pal} 5 | \alias{scale_color_load} 6 | \alias{scale_colour_load} 7 | \alias{scale_fill_load} 8 | \title{load palette} 9 | \usage{ 10 | load_pal(n, type = c("discrete", "continuous"), reverse = FALSE) 11 | 12 | scale_color_load(n, type = "discrete", reverse = FALSE, ...) 13 | 14 | scale_colour_load(n, type = "discrete", reverse = FALSE, ...) 15 | 16 | scale_fill_load(n, type = "discrete", reverse = FALSE, ...) 17 | } 18 | \arguments{ 19 | \item{n}{number of colors} 20 | 21 | \item{type}{discrete or continuous} 22 | 23 | \item{reverse}{reverse order, Default: FALSE} 24 | 25 | \item{...}{ 26 | Arguments passed on to \code{\link[ggplot2:discrete_scale]{ggplot2::discrete_scale}} 27 | \describe{ 28 | \item{\code{aesthetics}}{The names of the aesthetics that this scale works with.} 29 | \item{\code{scale_name}}{The name of the scale that should be used for error messages 30 | associated with this scale.} 31 | \item{\code{palette}}{A palette function that when called with a single integer 32 | argument (the number of levels in the scale) returns the values that 33 | they should take (e.g., \code{\link[scales:hue_pal]{scales::hue_pal()}}).} 34 | \item{\code{name}}{The name of the scale. Used as the axis or legend title. If 35 | \code{waiver()}, the default, the name of the scale is taken from the first 36 | mapping used for that aesthetic. If \code{NULL}, the legend title will be 37 | omitted.} 38 | \item{\code{breaks}}{One of: 39 | \itemize{ 40 | \item \code{NULL} for no breaks 41 | \item \code{waiver()} for the default breaks (the scale limits) 42 | \item A character vector of breaks 43 | \item A function that takes the limits as input and returns breaks 44 | as output. Also accepts rlang \link[rlang:as_function]{lambda} function 45 | notation. 46 | }} 47 | \item{\code{labels}}{One of: 48 | \itemize{ 49 | \item \code{NULL} for no labels 50 | \item \code{waiver()} for the default labels computed by the 51 | transformation object 52 | \item A character vector giving labels (must be same length as \code{breaks}) 53 | \item An expression vector (must be the same length as breaks). See ?plotmath for details. 54 | \item A function that takes the breaks as input and returns labels 55 | as output. Also accepts rlang \link[rlang:as_function]{lambda} function 56 | notation. 57 | }} 58 | \item{\code{limits}}{One of: 59 | \itemize{ 60 | \item \code{NULL} to use the default scale values 61 | \item A character vector that defines possible values of the scale and their 62 | order 63 | \item A function that accepts the existing (automatic) values and returns 64 | new ones. Also accepts rlang \link[rlang:as_function]{lambda} function 65 | notation. 66 | }} 67 | \item{\code{expand}}{For position scales, a vector of range expansion constants used to add some 68 | padding around the data to ensure that they are placed some distance 69 | away from the axes. Use the convenience function \code{\link[ggplot2:expansion]{expansion()}} 70 | to generate the values for the \code{expand} argument. The defaults are to 71 | expand the scale by 5\% on each side for continuous variables, and by 72 | 0.6 units on each side for discrete variables.} 73 | \item{\code{na.translate}}{Unlike continuous scales, discrete scales can easily show 74 | missing values, and do so by default. If you want to remove missing values 75 | from a discrete scale, specify \code{na.translate = FALSE}.} 76 | \item{\code{na.value}}{If \code{na.translate = TRUE}, what aesthetic value should the 77 | missing values be displayed as? Does not apply to position scales 78 | where \code{NA} is always placed at the far right.} 79 | \item{\code{drop}}{Should unused factor levels be omitted from the scale? 80 | The default, \code{TRUE}, uses the levels that appear in the data; 81 | \code{FALSE} uses all the levels in the factor.} 82 | \item{\code{guide}}{A function used to create a guide or its name. See 83 | \code{\link[ggplot2:guides]{guides()}} for more information.} 84 | \item{\code{position}}{For position scales, The position of the axis. 85 | \code{left} or \code{right} for y axes, \code{top} or \code{bottom} for x axes.} 86 | \item{\code{super}}{The super class to use for the constructed scale} 87 | }} 88 | } 89 | \description{ 90 | load palette 91 | } 92 | \examples{ 93 | library(scales) 94 | show_col(load_pal()(10),labels = FALSE) 95 | 96 | library(ggplot2) 97 | ggplot(airquality, aes(x = Day, y = Temp, 98 | group = as.factor(Month), color = as.factor(Month))) + 99 | geom_point(size = 2.5) + 100 | scale_color_load() 101 | 102 | ggplot(airquality, aes(x = Day, y = Temp, 103 | group = as.factor(Month), color = as.factor(Month))) + 104 | geom_point(size = 2.5) + 105 | scale_colour_load() 106 | 107 | ggplot(mpg, aes(displ)) + 108 | geom_histogram(aes(fill = class), 109 | col = "black", size = 0.1) + 110 | scale_fill_load() 111 | } 112 | -------------------------------------------------------------------------------- /man/magnetic_pal.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/magnetic_palette.R 3 | \name{magnetic_pal} 4 | \alias{magnetic_pal} 5 | \alias{scale_color_magnetic} 6 | \alias{scale_colour_magnetic} 7 | \alias{scale_fill_magnetic} 8 | \title{magnetic palette} 9 | \usage{ 10 | magnetic_pal(n, type = c("discrete", "continuous"), reverse = FALSE) 11 | 12 | scale_color_magnetic(n, type = "discrete", reverse = FALSE, ...) 13 | 14 | scale_colour_magnetic(n, type = "discrete", reverse = FALSE, ...) 15 | 16 | scale_fill_magnetic(n, type = "discrete", reverse = FALSE, ...) 17 | } 18 | \arguments{ 19 | \item{n}{number of colors} 20 | 21 | \item{type}{discrete or continuous} 22 | 23 | \item{reverse}{reverse order, Default: FALSE} 24 | 25 | \item{...}{ 26 | Arguments passed on to \code{\link[ggplot2:discrete_scale]{ggplot2::discrete_scale}} 27 | \describe{ 28 | \item{\code{aesthetics}}{The names of the aesthetics that this scale works with.} 29 | \item{\code{scale_name}}{The name of the scale that should be used for error messages 30 | associated with this scale.} 31 | \item{\code{palette}}{A palette function that when called with a single integer 32 | argument (the number of levels in the scale) returns the values that 33 | they should take (e.g., \code{\link[scales:hue_pal]{scales::hue_pal()}}).} 34 | \item{\code{name}}{The name of the scale. Used as the axis or legend title. If 35 | \code{waiver()}, the default, the name of the scale is taken from the first 36 | mapping used for that aesthetic. If \code{NULL}, the legend title will be 37 | omitted.} 38 | \item{\code{breaks}}{One of: 39 | \itemize{ 40 | \item \code{NULL} for no breaks 41 | \item \code{waiver()} for the default breaks (the scale limits) 42 | \item A character vector of breaks 43 | \item A function that takes the limits as input and returns breaks 44 | as output. Also accepts rlang \link[rlang:as_function]{lambda} function 45 | notation. 46 | }} 47 | \item{\code{labels}}{One of: 48 | \itemize{ 49 | \item \code{NULL} for no labels 50 | \item \code{waiver()} for the default labels computed by the 51 | transformation object 52 | \item A character vector giving labels (must be same length as \code{breaks}) 53 | \item An expression vector (must be the same length as breaks). See ?plotmath for details. 54 | \item A function that takes the breaks as input and returns labels 55 | as output. Also accepts rlang \link[rlang:as_function]{lambda} function 56 | notation. 57 | }} 58 | \item{\code{limits}}{One of: 59 | \itemize{ 60 | \item \code{NULL} to use the default scale values 61 | \item A character vector that defines possible values of the scale and their 62 | order 63 | \item A function that accepts the existing (automatic) values and returns 64 | new ones. Also accepts rlang \link[rlang:as_function]{lambda} function 65 | notation. 66 | }} 67 | \item{\code{expand}}{For position scales, a vector of range expansion constants used to add some 68 | padding around the data to ensure that they are placed some distance 69 | away from the axes. Use the convenience function \code{\link[ggplot2:expansion]{expansion()}} 70 | to generate the values for the \code{expand} argument. The defaults are to 71 | expand the scale by 5\% on each side for continuous variables, and by 72 | 0.6 units on each side for discrete variables.} 73 | \item{\code{na.translate}}{Unlike continuous scales, discrete scales can easily show 74 | missing values, and do so by default. If you want to remove missing values 75 | from a discrete scale, specify \code{na.translate = FALSE}.} 76 | \item{\code{na.value}}{If \code{na.translate = TRUE}, what aesthetic value should the 77 | missing values be displayed as? Does not apply to position scales 78 | where \code{NA} is always placed at the far right.} 79 | \item{\code{drop}}{Should unused factor levels be omitted from the scale? 80 | The default, \code{TRUE}, uses the levels that appear in the data; 81 | \code{FALSE} uses all the levels in the factor.} 82 | \item{\code{guide}}{A function used to create a guide or its name. See 83 | \code{\link[ggplot2:guides]{guides()}} for more information.} 84 | \item{\code{position}}{For position scales, The position of the axis. 85 | \code{left} or \code{right} for y axes, \code{top} or \code{bottom} for x axes.} 86 | \item{\code{super}}{The super class to use for the constructed scale} 87 | }} 88 | } 89 | \description{ 90 | magnetic palette 91 | } 92 | \examples{ 93 | library(scales) 94 | show_col(magnetic_pal()(10),labels = FALSE) 95 | 96 | library(ggplot2) 97 | ggplot(airquality, aes(x = Day, y = Temp, 98 | group = as.factor(Month), color = as.factor(Month))) + 99 | geom_point(size = 2.5) + 100 | scale_color_magnetic() 101 | 102 | ggplot(airquality, aes(x = Day, y = Temp, 103 | group = as.factor(Month), color = as.factor(Month))) + 104 | geom_point(size = 2.5) + 105 | scale_colour_magnetic() 106 | 107 | ggplot(mpg, aes(displ)) + 108 | geom_histogram(aes(fill = class), 109 | col = "black", size = 0.1) + 110 | scale_fill_magnetic() 111 | } 112 | -------------------------------------------------------------------------------- /man/metalli_palette.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/metallicart.R 3 | \name{metalli_palette} 4 | \alias{metalli_palette} 5 | \title{Color Palettes based on Metallica album covers} 6 | \usage{ 7 | metalli_palette(name, n, type = c("discrete", "continuous")) 8 | } 9 | \arguments{ 10 | \item{name}{Name of palette. Select one: 11 | \code{kill}, \code{kill10}, \code{lightning}, \code{lightning10}, 12 | \code{puppets}, \code{puppets10},\code{justice}, \code{justice10}, 13 | \code{metallica}, \code{metallica10}, \code{load},\code{load10}, 14 | \code{reload}, \code{reload10}, \code{anger}, \code{anger10}, 15 | \code{magnetic}, \code{magnetic10}, \code{hardwired}, \code{hardwired10}, 16 | \code{seasons10}, \code{seasons}, \code{combo}, \code{inomorata}} 17 | 18 | \item{n}{Number of colors desired. 19 | 20 | Some palettes contain 7 colors which were picked 'by hand' 21 | The \code{combo} palette and those ending with '10' have 10 colours. 22 | Apart from \code{combo} palette, these were produced with the 23 | aid of the \code{colorfindr} package : 24 | https://CRAN.R-project.org/package=colorfindr} 25 | 26 | \item{type}{Either continuous or discrete.} 27 | } 28 | \value{ 29 | A vector of colors. 30 | } 31 | \description{ 32 | R package that contains color palettes based on colours on Metallica studio album covers. 33 | } 34 | \details{ 35 | Yep, even the black album. 36 | 37 | This package is based on the nycpalettes package: https://github.com/kellycotton/nycpalettes 38 | } 39 | \examples{ 40 | metalli_palette("anger") 41 | 42 | } 43 | -------------------------------------------------------------------------------- /man/metallica_pal.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/metallica_palette.R 3 | \name{metallica_pal} 4 | \alias{metallica_pal} 5 | \alias{scale_color_metallica} 6 | \alias{scale_colour_metallica} 7 | \alias{scale_fill_metallica} 8 | \title{metallica palette} 9 | \usage{ 10 | metallica_pal(n, type = c("discrete", "continuous"), reverse = FALSE) 11 | 12 | scale_color_metallica(n, type = "discrete", reverse = FALSE, ...) 13 | 14 | scale_colour_metallica(n, type = "discrete", reverse = FALSE, ...) 15 | 16 | scale_fill_metallica(n, type = "discrete", reverse = FALSE, ...) 17 | } 18 | \arguments{ 19 | \item{n}{number of colors} 20 | 21 | \item{type}{discrete or continuous} 22 | 23 | \item{reverse}{reverse order, Default: FALSE} 24 | 25 | \item{...}{ 26 | Arguments passed on to \code{\link[ggplot2:discrete_scale]{ggplot2::discrete_scale}} 27 | \describe{ 28 | \item{\code{aesthetics}}{The names of the aesthetics that this scale works with.} 29 | \item{\code{scale_name}}{The name of the scale that should be used for error messages 30 | associated with this scale.} 31 | \item{\code{palette}}{A palette function that when called with a single integer 32 | argument (the number of levels in the scale) returns the values that 33 | they should take (e.g., \code{\link[scales:hue_pal]{scales::hue_pal()}}).} 34 | \item{\code{name}}{The name of the scale. Used as the axis or legend title. If 35 | \code{waiver()}, the default, the name of the scale is taken from the first 36 | mapping used for that aesthetic. If \code{NULL}, the legend title will be 37 | omitted.} 38 | \item{\code{breaks}}{One of: 39 | \itemize{ 40 | \item \code{NULL} for no breaks 41 | \item \code{waiver()} for the default breaks (the scale limits) 42 | \item A character vector of breaks 43 | \item A function that takes the limits as input and returns breaks 44 | as output. Also accepts rlang \link[rlang:as_function]{lambda} function 45 | notation. 46 | }} 47 | \item{\code{labels}}{One of: 48 | \itemize{ 49 | \item \code{NULL} for no labels 50 | \item \code{waiver()} for the default labels computed by the 51 | transformation object 52 | \item A character vector giving labels (must be same length as \code{breaks}) 53 | \item An expression vector (must be the same length as breaks). See ?plotmath for details. 54 | \item A function that takes the breaks as input and returns labels 55 | as output. Also accepts rlang \link[rlang:as_function]{lambda} function 56 | notation. 57 | }} 58 | \item{\code{limits}}{One of: 59 | \itemize{ 60 | \item \code{NULL} to use the default scale values 61 | \item A character vector that defines possible values of the scale and their 62 | order 63 | \item A function that accepts the existing (automatic) values and returns 64 | new ones. Also accepts rlang \link[rlang:as_function]{lambda} function 65 | notation. 66 | }} 67 | \item{\code{expand}}{For position scales, a vector of range expansion constants used to add some 68 | padding around the data to ensure that they are placed some distance 69 | away from the axes. Use the convenience function \code{\link[ggplot2:expansion]{expansion()}} 70 | to generate the values for the \code{expand} argument. The defaults are to 71 | expand the scale by 5\% on each side for continuous variables, and by 72 | 0.6 units on each side for discrete variables.} 73 | \item{\code{na.translate}}{Unlike continuous scales, discrete scales can easily show 74 | missing values, and do so by default. If you want to remove missing values 75 | from a discrete scale, specify \code{na.translate = FALSE}.} 76 | \item{\code{na.value}}{If \code{na.translate = TRUE}, what aesthetic value should the 77 | missing values be displayed as? Does not apply to position scales 78 | where \code{NA} is always placed at the far right.} 79 | \item{\code{drop}}{Should unused factor levels be omitted from the scale? 80 | The default, \code{TRUE}, uses the levels that appear in the data; 81 | \code{FALSE} uses all the levels in the factor.} 82 | \item{\code{guide}}{A function used to create a guide or its name. See 83 | \code{\link[ggplot2:guides]{guides()}} for more information.} 84 | \item{\code{position}}{For position scales, The position of the axis. 85 | \code{left} or \code{right} for y axes, \code{top} or \code{bottom} for x axes.} 86 | \item{\code{super}}{The super class to use for the constructed scale} 87 | }} 88 | } 89 | \description{ 90 | metallica palette 91 | } 92 | \examples{ 93 | library(scales) 94 | show_col(metallica_pal()(10),labels = FALSE) 95 | 96 | library(ggplot2) 97 | ggplot(airquality, aes(x = Day, y = Temp, 98 | group = as.factor(Month), color = as.factor(Month))) + 99 | geom_point(size = 2.5) + 100 | scale_color_metallica() 101 | 102 | ggplot(airquality, aes(x = Day, y = Temp, 103 | group = as.factor(Month), color = as.factor(Month))) + 104 | geom_point(size = 2.5) + 105 | scale_colour_metallica() 106 | 107 | ggplot(mpg, aes(displ)) + 108 | geom_histogram(aes(fill = class), 109 | col = "black", size = 0.1) + 110 | scale_fill_metallica() 111 | } 112 | -------------------------------------------------------------------------------- /man/puppets_pal.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/puppets_palette.R 3 | \name{puppets_pal} 4 | \alias{puppets_pal} 5 | \alias{scale_color_puppets} 6 | \alias{scale_colour_puppets} 7 | \alias{scale_fill_puppets} 8 | \title{puppets palette} 9 | \usage{ 10 | puppets_pal(n, type = c("discrete", "continuous"), reverse = FALSE) 11 | 12 | scale_color_puppets(n, type = "discrete", reverse = FALSE, ...) 13 | 14 | scale_colour_puppets(n, type = "discrete", reverse = FALSE, ...) 15 | 16 | scale_fill_puppets(n, type = "discrete", reverse = FALSE, ...) 17 | } 18 | \arguments{ 19 | \item{n}{number of colors} 20 | 21 | \item{type}{discrete or continuous} 22 | 23 | \item{reverse}{reverse order, Default: FALSE} 24 | 25 | \item{...}{ 26 | Arguments passed on to \code{\link[ggplot2:discrete_scale]{ggplot2::discrete_scale}} 27 | \describe{ 28 | \item{\code{aesthetics}}{The names of the aesthetics that this scale works with.} 29 | \item{\code{scale_name}}{The name of the scale that should be used for error messages 30 | associated with this scale.} 31 | \item{\code{palette}}{A palette function that when called with a single integer 32 | argument (the number of levels in the scale) returns the values that 33 | they should take (e.g., \code{\link[scales:hue_pal]{scales::hue_pal()}}).} 34 | \item{\code{name}}{The name of the scale. Used as the axis or legend title. If 35 | \code{waiver()}, the default, the name of the scale is taken from the first 36 | mapping used for that aesthetic. If \code{NULL}, the legend title will be 37 | omitted.} 38 | \item{\code{breaks}}{One of: 39 | \itemize{ 40 | \item \code{NULL} for no breaks 41 | \item \code{waiver()} for the default breaks (the scale limits) 42 | \item A character vector of breaks 43 | \item A function that takes the limits as input and returns breaks 44 | as output. Also accepts rlang \link[rlang:as_function]{lambda} function 45 | notation. 46 | }} 47 | \item{\code{labels}}{One of: 48 | \itemize{ 49 | \item \code{NULL} for no labels 50 | \item \code{waiver()} for the default labels computed by the 51 | transformation object 52 | \item A character vector giving labels (must be same length as \code{breaks}) 53 | \item An expression vector (must be the same length as breaks). See ?plotmath for details. 54 | \item A function that takes the breaks as input and returns labels 55 | as output. Also accepts rlang \link[rlang:as_function]{lambda} function 56 | notation. 57 | }} 58 | \item{\code{limits}}{One of: 59 | \itemize{ 60 | \item \code{NULL} to use the default scale values 61 | \item A character vector that defines possible values of the scale and their 62 | order 63 | \item A function that accepts the existing (automatic) values and returns 64 | new ones. Also accepts rlang \link[rlang:as_function]{lambda} function 65 | notation. 66 | }} 67 | \item{\code{expand}}{For position scales, a vector of range expansion constants used to add some 68 | padding around the data to ensure that they are placed some distance 69 | away from the axes. Use the convenience function \code{\link[ggplot2:expansion]{expansion()}} 70 | to generate the values for the \code{expand} argument. The defaults are to 71 | expand the scale by 5\% on each side for continuous variables, and by 72 | 0.6 units on each side for discrete variables.} 73 | \item{\code{na.translate}}{Unlike continuous scales, discrete scales can easily show 74 | missing values, and do so by default. If you want to remove missing values 75 | from a discrete scale, specify \code{na.translate = FALSE}.} 76 | \item{\code{na.value}}{If \code{na.translate = TRUE}, what aesthetic value should the 77 | missing values be displayed as? Does not apply to position scales 78 | where \code{NA} is always placed at the far right.} 79 | \item{\code{drop}}{Should unused factor levels be omitted from the scale? 80 | The default, \code{TRUE}, uses the levels that appear in the data; 81 | \code{FALSE} uses all the levels in the factor.} 82 | \item{\code{guide}}{A function used to create a guide or its name. See 83 | \code{\link[ggplot2:guides]{guides()}} for more information.} 84 | \item{\code{position}}{For position scales, The position of the axis. 85 | \code{left} or \code{right} for y axes, \code{top} or \code{bottom} for x axes.} 86 | \item{\code{super}}{The super class to use for the constructed scale} 87 | }} 88 | } 89 | \description{ 90 | puppets palette 91 | } 92 | \examples{ 93 | library(scales) 94 | show_col(puppets_pal()(10),labels = FALSE) 95 | 96 | library(ggplot2) 97 | ggplot(airquality, aes(x = Day, y = Temp, 98 | group = as.factor(Month), color = as.factor(Month))) + 99 | geom_point(size = 2.5) + 100 | scale_color_puppets() 101 | 102 | ggplot(airquality, aes(x = Day, y = Temp, 103 | group = as.factor(Month), color = as.factor(Month))) + 104 | geom_point(size = 2.5) + 105 | scale_colour_puppets() 106 | 107 | ggplot(mpg, aes(displ)) + 108 | geom_histogram(aes(fill = class), 109 | col = "black", size = 0.1) + 110 | scale_fill_puppets() 111 | } 112 | -------------------------------------------------------------------------------- /man/reload_pal.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/reload_palette.R 3 | \name{reload_pal} 4 | \alias{reload_pal} 5 | \alias{scale_color_reload} 6 | \alias{scale_colour_reload} 7 | \alias{scale_fill_reload} 8 | \title{reload palette} 9 | \usage{ 10 | reload_pal(n, type = c("discrete", "continuous"), reverse = FALSE) 11 | 12 | scale_color_reload(n, type = "discrete", reverse = FALSE, ...) 13 | 14 | scale_colour_reload(n, type = "discrete", reverse = FALSE, ...) 15 | 16 | scale_fill_reload(n, type = "discrete", reverse = FALSE, ...) 17 | } 18 | \arguments{ 19 | \item{n}{number of colors} 20 | 21 | \item{type}{discrete or continuous} 22 | 23 | \item{reverse}{reverse order, Default: FALSE} 24 | 25 | \item{...}{ 26 | Arguments passed on to \code{\link[ggplot2:discrete_scale]{ggplot2::discrete_scale}} 27 | \describe{ 28 | \item{\code{aesthetics}}{The names of the aesthetics that this scale works with.} 29 | \item{\code{scale_name}}{The name of the scale that should be used for error messages 30 | associated with this scale.} 31 | \item{\code{palette}}{A palette function that when called with a single integer 32 | argument (the number of levels in the scale) returns the values that 33 | they should take (e.g., \code{\link[scales:hue_pal]{scales::hue_pal()}}).} 34 | \item{\code{name}}{The name of the scale. Used as the axis or legend title. If 35 | \code{waiver()}, the default, the name of the scale is taken from the first 36 | mapping used for that aesthetic. If \code{NULL}, the legend title will be 37 | omitted.} 38 | \item{\code{breaks}}{One of: 39 | \itemize{ 40 | \item \code{NULL} for no breaks 41 | \item \code{waiver()} for the default breaks (the scale limits) 42 | \item A character vector of breaks 43 | \item A function that takes the limits as input and returns breaks 44 | as output. Also accepts rlang \link[rlang:as_function]{lambda} function 45 | notation. 46 | }} 47 | \item{\code{labels}}{One of: 48 | \itemize{ 49 | \item \code{NULL} for no labels 50 | \item \code{waiver()} for the default labels computed by the 51 | transformation object 52 | \item A character vector giving labels (must be same length as \code{breaks}) 53 | \item An expression vector (must be the same length as breaks). See ?plotmath for details. 54 | \item A function that takes the breaks as input and returns labels 55 | as output. Also accepts rlang \link[rlang:as_function]{lambda} function 56 | notation. 57 | }} 58 | \item{\code{limits}}{One of: 59 | \itemize{ 60 | \item \code{NULL} to use the default scale values 61 | \item A character vector that defines possible values of the scale and their 62 | order 63 | \item A function that accepts the existing (automatic) values and returns 64 | new ones. Also accepts rlang \link[rlang:as_function]{lambda} function 65 | notation. 66 | }} 67 | \item{\code{expand}}{For position scales, a vector of range expansion constants used to add some 68 | padding around the data to ensure that they are placed some distance 69 | away from the axes. Use the convenience function \code{\link[ggplot2:expansion]{expansion()}} 70 | to generate the values for the \code{expand} argument. The defaults are to 71 | expand the scale by 5\% on each side for continuous variables, and by 72 | 0.6 units on each side for discrete variables.} 73 | \item{\code{na.translate}}{Unlike continuous scales, discrete scales can easily show 74 | missing values, and do so by default. If you want to remove missing values 75 | from a discrete scale, specify \code{na.translate = FALSE}.} 76 | \item{\code{na.value}}{If \code{na.translate = TRUE}, what aesthetic value should the 77 | missing values be displayed as? Does not apply to position scales 78 | where \code{NA} is always placed at the far right.} 79 | \item{\code{drop}}{Should unused factor levels be omitted from the scale? 80 | The default, \code{TRUE}, uses the levels that appear in the data; 81 | \code{FALSE} uses all the levels in the factor.} 82 | \item{\code{guide}}{A function used to create a guide or its name. See 83 | \code{\link[ggplot2:guides]{guides()}} for more information.} 84 | \item{\code{position}}{For position scales, The position of the axis. 85 | \code{left} or \code{right} for y axes, \code{top} or \code{bottom} for x axes.} 86 | \item{\code{super}}{The super class to use for the constructed scale} 87 | }} 88 | } 89 | \description{ 90 | reload palette 91 | } 92 | \examples{ 93 | library(scales) 94 | show_col(reload_pal()(10),labels = FALSE) 95 | 96 | library(ggplot2) 97 | ggplot(airquality, aes(x = Day, y = Temp, 98 | group = as.factor(Month), color = as.factor(Month))) + 99 | geom_point(size = 2.5) + 100 | scale_color_reload() 101 | 102 | ggplot(airquality, aes(x = Day, y = Temp, 103 | group = as.factor(Month), color = as.factor(Month))) + 104 | geom_point(size = 2.5) + 105 | scale_colour_reload() 106 | 107 | ggplot(mpg, aes(displ)) + 108 | geom_histogram(aes(fill = class), 109 | col = "black", size = 0.1) + 110 | scale_fill_reload() 111 | } 112 | -------------------------------------------------------------------------------- /man/seasons_pal.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/seasons_palette.R 3 | \name{seasons_pal} 4 | \alias{seasons_pal} 5 | \alias{scale_color_seasons} 6 | \alias{scale_colour_seasons} 7 | \alias{scale_fill_seasons} 8 | \title{seasons palette} 9 | \usage{ 10 | seasons_pal(n, type = c("discrete", "continuous"), reverse = FALSE) 11 | 12 | scale_color_seasons(n, type = "discrete", reverse = FALSE, ...) 13 | 14 | scale_colour_seasons(n, type = "discrete", reverse = FALSE, ...) 15 | 16 | scale_fill_seasons(n, type = "discrete", reverse = FALSE, ...) 17 | } 18 | \arguments{ 19 | \item{n}{number of colors} 20 | 21 | \item{type}{discrete or continuous} 22 | 23 | \item{reverse}{reverse order, Default: FALSE} 24 | 25 | \item{...}{ 26 | Arguments passed on to \code{\link[ggplot2:discrete_scale]{ggplot2::discrete_scale}} 27 | \describe{ 28 | \item{\code{aesthetics}}{The names of the aesthetics that this scale works with.} 29 | \item{\code{scale_name}}{The name of the scale that should be used for error messages 30 | associated with this scale.} 31 | \item{\code{palette}}{A palette function that when called with a single integer 32 | argument (the number of levels in the scale) returns the values that 33 | they should take (e.g., \code{\link[scales:hue_pal]{scales::hue_pal()}}).} 34 | \item{\code{name}}{The name of the scale. Used as the axis or legend title. If 35 | \code{waiver()}, the default, the name of the scale is taken from the first 36 | mapping used for that aesthetic. If \code{NULL}, the legend title will be 37 | omitted.} 38 | \item{\code{breaks}}{One of: 39 | \itemize{ 40 | \item \code{NULL} for no breaks 41 | \item \code{waiver()} for the default breaks (the scale limits) 42 | \item A character vector of breaks 43 | \item A function that takes the limits as input and returns breaks 44 | as output. Also accepts rlang \link[rlang:as_function]{lambda} function 45 | notation. 46 | }} 47 | \item{\code{labels}}{One of: 48 | \itemize{ 49 | \item \code{NULL} for no labels 50 | \item \code{waiver()} for the default labels computed by the 51 | transformation object 52 | \item A character vector giving labels (must be same length as \code{breaks}) 53 | \item An expression vector (must be the same length as breaks). See ?plotmath for details. 54 | \item A function that takes the breaks as input and returns labels 55 | as output. Also accepts rlang \link[rlang:as_function]{lambda} function 56 | notation. 57 | }} 58 | \item{\code{limits}}{One of: 59 | \itemize{ 60 | \item \code{NULL} to use the default scale values 61 | \item A character vector that defines possible values of the scale and their 62 | order 63 | \item A function that accepts the existing (automatic) values and returns 64 | new ones. Also accepts rlang \link[rlang:as_function]{lambda} function 65 | notation. 66 | }} 67 | \item{\code{expand}}{For position scales, a vector of range expansion constants used to add some 68 | padding around the data to ensure that they are placed some distance 69 | away from the axes. Use the convenience function \code{\link[ggplot2:expansion]{expansion()}} 70 | to generate the values for the \code{expand} argument. The defaults are to 71 | expand the scale by 5\% on each side for continuous variables, and by 72 | 0.6 units on each side for discrete variables.} 73 | \item{\code{na.translate}}{Unlike continuous scales, discrete scales can easily show 74 | missing values, and do so by default. If you want to remove missing values 75 | from a discrete scale, specify \code{na.translate = FALSE}.} 76 | \item{\code{na.value}}{If \code{na.translate = TRUE}, what aesthetic value should the 77 | missing values be displayed as? Does not apply to position scales 78 | where \code{NA} is always placed at the far right.} 79 | \item{\code{drop}}{Should unused factor levels be omitted from the scale? 80 | The default, \code{TRUE}, uses the levels that appear in the data; 81 | \code{FALSE} uses all the levels in the factor.} 82 | \item{\code{guide}}{A function used to create a guide or its name. See 83 | \code{\link[ggplot2:guides]{guides()}} for more information.} 84 | \item{\code{position}}{For position scales, The position of the axis. 85 | \code{left} or \code{right} for y axes, \code{top} or \code{bottom} for x axes.} 86 | \item{\code{super}}{The super class to use for the constructed scale} 87 | }} 88 | } 89 | \description{ 90 | seasons palette 91 | } 92 | \examples{ 93 | library(scales) 94 | show_col(seasons_pal()(10),labels = FALSE) 95 | 96 | library(ggplot2) 97 | ggplot(airquality, aes(x = Day, y = Temp, 98 | group = as.factor(Month), color = as.factor(Month))) + 99 | geom_point(size = 2.5) + 100 | scale_color_seasons() 101 | 102 | ggplot(airquality, aes(x = Day, y = Temp, 103 | group = as.factor(Month), color = as.factor(Month))) + 104 | geom_point(size = 2.5) + 105 | scale_colour_seasons() 106 | 107 | ggplot(mpg, aes(displ)) + 108 | geom_histogram(aes(fill = class), 109 | col = "black", size = 0.1) + 110 | scale_fill_seasons() 111 | } 112 | -------------------------------------------------------------------------------- /metallicaRt.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | 15 | BuildType: Package 16 | PackageUseDevtools: Yes 17 | PackageInstallArgs: --no-multiarch --with-keep.source 18 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | metallicaRt 2 | ================ 3 | 4 | 5 | 6 | ![R-CMD-check](https://github.com/johnmackintosh/metallicaRt/workflows/R-CMD-check/badge.svg) 7 | 8 | 9 | 10 | # 11 | 12 | ## What? 13 | 14 | On a whim, this is a collection of colour palettes based on Metallica 15 | album covers. 16 | 17 | Each is named using an abbreviation of the relevant album. 18 | 19 | ## Why? 20 | 21 | Because I saw [this 22 | post](https://github.com/annahensch/R-tutorials/blob/master/ggplot-on-fire.md) 23 | on Twitter 24 | 25 | ## But still, …why? 26 | 27 | Because I’d already created a bunch of palettes manually for [this post 28 | on my 29 | blog](https://johnmackintosh.net/blog/2018-01-29-hardwired-for-tidy-text/) 30 | 31 | ## How? 32 | 33 | I produced the palettes with 7 colours using an online tool, when I 34 | produced my blog post originally. I also put together the ‘combo’ 35 | palette. 36 | 37 | Palettes that end with ‘10’ were created using 38 | [colorfindr](https://CRAN.R-project.org/package=colorfindr) 39 | 40 | ## Credit 41 | 42 | Thanks to Kelly Cotton for [the nycpalettes 43 | package](https://github.com/kellycotton/nycpalettes) which this was 44 | extremely heavily based on 45 | 46 | ## I need this in my life 47 | 48 | Of course you do. This will not go to CRAN, so please install using the 49 | remotes package. 50 | 51 | ``` r 52 | #library(remotes) 53 | #remotes::install_github("johnmackintosh/metallicaRt") 54 | library(metallicaRt) 55 | ``` 56 | 57 | ## Data Viz Friendly 58 | 59 | These mini palettes *might* actually be useful. 60 | 61 | All named after a song title from the relevant album 62 | 63 | ``` r 64 | metalli_palette("whiplash") 65 | metalli_palette("bells") 66 | metalli_palette("orion") 67 | metalli_palette("blackened") 68 | ``` 69 | 70 | 71 | 72 | ``` r 73 | metalli_palette("roam") 74 | metalli_palette("bleeding") 75 | metalli_palette("fuel") 76 | ``` 77 | 78 | 79 | 80 | ``` r 81 | metalli_palette("frantic") 82 | metalli_palette("scarred") 83 | metalli_palette("revenge") 84 | metalli_palette("inomorata") 85 | ``` 86 | 87 | 88 | 89 | ## Gimme fuel, gimme fire, longer palettes I desire 90 | 91 | OK then. 92 | 93 | These contain more album specific colors, but might be of less practical 94 | use for data visualisation purposes. 95 | 96 | # Kill ’Em All 97 | 98 | ``` r 99 | metalli_palette("kill") 100 | scales::show_col(killem_pal()(10), labels = FALSE) 101 | ``` 102 | 103 | 104 | 105 | ## Ride The Lightning 106 | 107 | ``` r 108 | metalli_palette("rtl") 109 | scales::show_col(lightning_pal()(10), labels = FALSE) 110 | ``` 111 | 112 | 113 | 114 | ## Master of Puppets 115 | 116 | ``` r 117 | metalli_palette("puppets") 118 | scales::show_col(puppets_pal()(10), labels = FALSE) 119 | ``` 120 | 121 | 122 | 123 | ## …And Justice For All 124 | 125 | ``` r 126 | metalli_palette("justice") 127 | scales::show_col(justice_pal()(10), labels = FALSE) 128 | ``` 129 | 130 | 131 | 132 | ## Metallica 133 | 134 | How much more black could it be? Don’t use this. 135 | 136 | ``` r 137 | metalli_palette("metallica") 138 | scales::show_col(metallica_pal()(10), labels = FALSE) 139 | ``` 140 | 141 | 142 | 143 | ## Load 144 | 145 | ``` r 146 | metalli_palette("load") 147 | scales::show_col(load_pal()(10), labels = FALSE) 148 | ``` 149 | 150 | 151 | 152 | ## Reload 153 | 154 | ``` r 155 | metalli_palette("reload") 156 | scales::show_col(reload_pal()(10), labels = FALSE) 157 | ``` 158 | 159 | 160 | 161 | ## St. Anger 162 | 163 | ``` r 164 | metalli_palette("anger") 165 | scales::show_col(anger_pal()(10), labels = FALSE) 166 | ``` 167 | 168 | 169 | 170 | ## Death Magnetic 171 | 172 | ``` r 173 | metalli_palette("magnetic") 174 | scales::show_col(magnetic_pal()(10), labels = FALSE) 175 | ``` 176 | 177 | 178 | 179 | ## Hardwired…To Self Destruct 180 | 181 | ``` r 182 | metalli_palette("hardwired") 183 | scales::show_col(hardwired_pal()(10), labels = FALSE) 184 | ``` 185 | 186 | 187 | 188 | ## 72 Seasons 189 | 190 | ``` r 191 | metalli_palette("seasons") 192 | scales::show_col(seasons_pal()(10), labels = FALSE) 193 | ``` 194 | 195 | 196 | 197 | ## Metal up your palette 198 | 199 | Various colours pilfered from various palettes 200 | 201 | ``` r 202 | scales::show_col(combo_pal()(10), labels = FALSE) 203 | ``` 204 | 205 | 206 | -------------------------------------------------------------------------------- /readme.rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "metallicaRt" 3 | output: github_document 4 | --- 5 | 6 | ```{r setup, include=FALSE} 7 | knitr::opts_chunk$set( 8 | collapse = TRUE, 9 | comment = "#>", 10 | fig.path = "man/figures/README-", 11 | fig.width = 3, 12 | fig.height = 2 13 | ) 14 | ``` 15 | 16 | 17 | 18 | ![R-CMD-check](https://github.com/johnmackintosh/metallicaRt/workflows/R-CMD-check/badge.svg) 19 | 20 | 21 | 22 | # 23 | 24 | 25 | ## What? 26 | 27 | On a whim, this is a collection of colour palettes based on Metallica album covers. 28 | 29 | Each is named using an abbreviation of the relevant album. 30 | 31 | ## Why? 32 | 33 | Because I saw [this post](https://github.com/annahensch/R-tutorials/blob/master/ggplot-on-fire.md) on Twitter 34 | 35 | 36 | ## But still, ...why? 37 | 38 | Because I'd already created a bunch of palettes manually for [this post on my blog](https://johnmackintosh.net/blog/2018-01-29-hardwired-for-tidy-text/) 39 | 40 | 41 | ## How? 42 | 43 | I produced the palettes with 7 colours using an online tool, when I produced 44 | my blog post originally. I also put together the 'combo' palette. 45 | 46 | Palettes that end with '10' were created using [colorfindr](https://CRAN.R-project.org/package=colorfindr) 47 | 48 | 49 | ## Credit 50 | 51 | Thanks to Kelly Cotton for [the nycpalettes package](https://github.com/kellycotton/nycpalettes) which this was extremely heavily based on 52 | 53 | 54 | ## I need this in my life 55 | 56 | Of course you do. 57 | This will not go to CRAN, so please install using the remotes package. 58 | 59 | ```{r} 60 | #library(remotes) 61 | #remotes::install_github("johnmackintosh/metallicaRt") 62 | library(metallicaRt) 63 | ``` 64 | 65 | 66 | ## Data Viz Friendly 67 | 68 | These mini palettes _might_ actually be useful. 69 | 70 | All named after a song title from the relevant album 71 | 72 | 73 | ```{r first4, fig.show="hold", out.width= "25%"} 74 | metalli_palette("whiplash") 75 | metalli_palette("bells") 76 | metalli_palette("orion") 77 | metalli_palette("blackened") 78 | ``` 79 | 80 | 81 | 82 | ```{r roam, fig.show="hold", out.width = "33%"} 83 | metalli_palette("roam") 84 | metalli_palette("bleeding") 85 | metalli_palette("fuel") 86 | ``` 87 | 88 | 89 | 90 | ```{r frantic, fig.show="hold", out.width = "25%"} 91 | metalli_palette("frantic") 92 | metalli_palette("scarred") 93 | metalli_palette("revenge") 94 | metalli_palette("inomorata") 95 | ``` 96 | 97 | 98 | 99 | ## Gimme fuel, gimme fire, longer palettes I desire 100 | 101 | 102 | OK then. 103 | 104 | These contain more album specific colors, but might be of less practical use 105 | for data visualisation purposes. 106 | 107 | 108 | 109 | # Kill 'Em All 110 | ```{r kill, fig.show="hold", out.width = "50%"} 111 | metalli_palette("kill") 112 | scales::show_col(killem_pal()(10), labels = FALSE) 113 | ``` 114 | 115 | 116 | ## Ride The Lightning 117 | 118 | ```{r rtl,fig.show="hold", out.width = "50%" } 119 | metalli_palette("rtl") 120 | scales::show_col(lightning_pal()(10), labels = FALSE) 121 | ``` 122 | 123 | 124 | ## Master of Puppets 125 | 126 | ```{r mop, fig.show="hold", out.width = "50%" } 127 | metalli_palette("puppets") 128 | scales::show_col(puppets_pal()(10), labels = FALSE) 129 | ``` 130 | 131 | 132 | ## ...And Justice For All 133 | 134 | ```{r ajfa, fig.show="hold", out.width = "50%" } 135 | metalli_palette("justice") 136 | scales::show_col(justice_pal()(10), labels = FALSE) 137 | ``` 138 | 139 | ## Metallica 140 | 141 | How much more black could it be? 142 | Don't use this. 143 | 144 | ```{r metallica,fig.show="hold", out.width = "50%" } 145 | metalli_palette("metallica") 146 | scales::show_col(metallica_pal()(10), labels = FALSE) 147 | ``` 148 | 149 | 150 | ## Load 151 | 152 | ```{r load,fig.show="hold", out.width = "50%" } 153 | metalli_palette("load") 154 | scales::show_col(load_pal()(10), labels = FALSE) 155 | ``` 156 | 157 | 158 | ## Reload 159 | 160 | ```{r reload, fig.show="hold", out.width = "50%" } 161 | metalli_palette("reload") 162 | scales::show_col(reload_pal()(10), labels = FALSE) 163 | ``` 164 | 165 | 166 | ## St. Anger 167 | 168 | ```{r stanger, fig.show="hold", out.width = "50%" } 169 | metalli_palette("anger") 170 | scales::show_col(anger_pal()(10), labels = FALSE) 171 | ``` 172 | 173 | 174 | ## Death Magnetic 175 | 176 | ```{r magnetic, fig.show="hold", out.width = "50%" } 177 | metalli_palette("magnetic") 178 | scales::show_col(magnetic_pal()(10), labels = FALSE) 179 | ``` 180 | 181 | 182 | ## Hardwired...To Self Destruct 183 | 184 | ```{r destruct, fig.show="hold", out.width = "50%" } 185 | metalli_palette("hardwired") 186 | scales::show_col(hardwired_pal()(10), labels = FALSE) 187 | ``` 188 | 189 | 190 | ## 72 Seasons 191 | 192 | ```{r seasons, fig.show="hold", out.width = "50%" } 193 | metalli_palette("seasons") 194 | scales::show_col(seasons_pal()(10), labels = FALSE) 195 | ``` 196 | 197 | 198 | 199 | ## Metal up your palette 200 | 201 | Various colours pilfered from various palettes 202 | 203 | ```{r combo, fig.show="hold", out.width = "50%"} 204 | scales::show_col(combo_pal()(10), labels = FALSE) 205 | ``` 206 | 207 | --------------------------------------------------------------------------------