├── inst └── WORDLIST ├── LICENSE ├── .gitignore ├── NEWS.md ├── man ├── figures │ ├── README-ggplot-1.png │ └── README-palette-1.png ├── rtist_palettes.Rd ├── rtist_help.Rd └── rtist_palette.Rd ├── .travis.yml ├── .Rbuildignore ├── NAMESPACE ├── DESCRIPTION ├── cran-comments.md ├── rtist.Rproj ├── LICENSE.md ├── R ├── rtist_help.R └── colours.R ├── README.Rmd └── README.md /inst/WORDLIST: -------------------------------------------------------------------------------- 1 | Ewen 2 | Karthik 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | YEAR: 2020 2 | COPYRIGHT HOLDER: Tomas Okal 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | .Ruserdata 5 | -------------------------------------------------------------------------------- /NEWS.md: -------------------------------------------------------------------------------- 1 | # rtist 1.0.0 2 | 3 | * Added a `NEWS.md` file to track changes to the package. 4 | -------------------------------------------------------------------------------- /man/figures/README-ggplot-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasokal/rtist/HEAD/man/figures/README-ggplot-1.png -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: R 2 | language: r 3 | r: 4 | - oldrel 5 | - release 6 | - devel 7 | cache: packages 8 | -------------------------------------------------------------------------------- /man/figures/README-palette-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasokal/rtist/HEAD/man/figures/README-palette-1.png -------------------------------------------------------------------------------- /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^.*\.Rproj$ 2 | ^\.Rproj\.user$ 3 | ^README\.Rmd$ 4 | ^LICENSE.md 5 | ^cran_comments\.md$ 6 | ^figures$ 7 | ^README-.*\.png$ 8 | ^cran-comments\.md$ 9 | ^\.travis\.yml$ 10 | ^CRAN-RELEASE$ 11 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | S3method(print,palette) 4 | export(rtist_help) 5 | export(rtist_palette) 6 | export(rtist_palettes) 7 | importFrom(grDevices,rgb) 8 | importFrom(graphics,image) 9 | importFrom(graphics,par) 10 | importFrom(graphics,rect) 11 | importFrom(graphics,text) 12 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: rtist 2 | Version: 1.0.0 3 | Date: 2020-02-15 4 | Title: A Color Palette Generator 5 | Description: Color palettes from famous artists and paintings. 6 | Author: Tomas Okal 7 | Maintainer: Tomas Okal 8 | Encoding: UTF-8 9 | RoxygenNote: 7.0.2 10 | License: MIT + file LICENSE 11 | -------------------------------------------------------------------------------- /cran-comments.md: -------------------------------------------------------------------------------- 1 | ## Test environments 2 | * local Windows, R 3.6.1 3 | * ubuntu 16.04 (on travis-ci), R release, devel, and oldrel 4 | * check_win_release() 5 | * check_win_devel() 6 | * check_win_oldrelease() 7 | * check_rhub() 8 | 9 | ## R CMD check results 10 | 11 | 0 errors | 0 warnings | 0 notes 12 | 13 | There were no ERRORs, WARNINGs or NOTEs. 14 | 15 | * This is a new release. 16 | -------------------------------------------------------------------------------- /man/rtist_palettes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/colours.R 3 | \docType{data} 4 | \name{rtist_palettes} 5 | \alias{rtist_palettes} 6 | \title{Complete list of palettes.} 7 | \format{An object of class \code{list} of length 15.} 8 | \usage{ 9 | rtist_palettes 10 | } 11 | \description{ 12 | Use \code{\link{rtist_palette}} to construct palettes of desired length. 13 | } 14 | \keyword{datasets} 15 | -------------------------------------------------------------------------------- /man/rtist_help.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/rtist_help.R 3 | \name{rtist_help} 4 | \alias{rtist_help} 5 | \title{Name and painting for all rtist palettes} 6 | \usage{ 7 | rtist_help() 8 | } 9 | \value{ 10 | A printed list of rtist palettes with name of their associated painting and artist. 11 | } 12 | \description{ 13 | Use function to get a print of all palettes with painting and artist name. 14 | } 15 | \examples{ 16 | rtist_help() 17 | } 18 | -------------------------------------------------------------------------------- /rtist.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 4 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | 15 | AutoAppendNewline: Yes 16 | StripTrailingWhitespace: Yes 17 | 18 | BuildType: Package 19 | PackageUseDevtools: Yes 20 | PackageInstallArgs: --no-multiarch --with-keep.source 21 | PackageCheckArgs: --as-cran 22 | PackageRoxygenize: rd,collate,namespace,vignette 23 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # MIT License 2 | 3 | Copyright (c) 2020 Tomas Okal 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 | -------------------------------------------------------------------------------- /man/rtist_palette.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/colours.R 3 | \name{rtist_palette} 4 | \alias{rtist_palette} 5 | \title{Artist and painting palette generator} 6 | \usage{ 7 | rtist_palette(artist, n) 8 | } 9 | \arguments{ 10 | \item{artist}{Name of desired artist palette. Choices are: 11 | \code{raphael}, \code{hokusai}, \code{vermeer}, \code{degas}, \code{davinci}, \code{vangogh}, \code{hopper}, \code{klimt}, \code{rembrandt}, \code{munch}, \code{okeeffe}, \code{warhol}, \code{oldenburg}, \code{picasso}, \code{pollock}} 12 | 13 | \item{n}{Number of colors desired. All palettes have 5 colors. Most color schemes are derived from \href{http://www.skellermeyerdesigns.com/blog/10-color-palettes-based-on-famous-paintings}{10 Color Palettes Based on Famous Paintings}. If omitted, will use all colors.} 14 | } 15 | \value{ 16 | A vector of colors. 17 | } 18 | \description{ 19 | Pick an artist name and number of colors desired. 20 | } 21 | \examples{ 22 | rtist_palette("warhol") 23 | rtist_palette("pollock", 4) 24 | } 25 | \keyword{art} 26 | \keyword{color} 27 | \keyword{colors} 28 | \keyword{colour} 29 | \keyword{colours} 30 | \keyword{palette} 31 | -------------------------------------------------------------------------------- /R/rtist_help.R: -------------------------------------------------------------------------------- 1 | #' Name and painting for all rtist palettes 2 | #' 3 | #' Use function to get a print of all palettes with painting and artist name. 4 | #' 5 | #' @return A printed list of rtist palettes with name of their associated painting and artist. 6 | #' @export 7 | #' 8 | #' @examples rtist_help() 9 | 10 | rtist_help <- function() { 11 | 12 | rtist_list <- data.frame(rtist = c("raphael", "hokusai", "vermeer", "degas", "davinci", "vangogh", "hopper", "klimt", "rembrandt", "munch", "warhol", "okeeffe", "oldenburg", "picasso", "pollock"), 13 | Painting = c("Saint Catherine of Alexandria", "Great Wave off Kanagawa", "Girl with a Pearl Earring", "L Etoile", "Mona Lisa", "Starry Night", "Nighthawks", "The Kiss", "The Nightwatch", "The Scream", "Flower, 1964", "Abstraction Blue", "Red Tights with Fragment 9", "The Dream", "Number 1"), 14 | Artist = c("Raphael", "Hokusai", "Johannes Vermeer", "Edgar Degas", "Leonardo Da Vinci", "Vincent Van Gogh", "Edward Hopper", "Gustav Klimt", "Rembrandt", "Edward Munch", "Andy Warhol", "Georgia O'Keeffe", "Claes Oldenburg", "Pablo Picasso", "Jackson Pollock") 15 | ) 16 | 17 | print(rtist_list) 18 | 19 | } 20 | 21 | 22 | -------------------------------------------------------------------------------- /README.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | output: github_document 3 | --- 4 | 5 | 6 | 7 | ```{r, include = FALSE} 8 | knitr::opts_chunk$set( 9 | collapse = TRUE, 10 | comment = "#>", 11 | fig.path = "man/figures/README-", 12 | out.width = "100%" 13 | ) 14 | 15 | library(ggplot2) 16 | library(rtist) 17 | ``` 18 | 19 | # rtist 20 | 21 | [![Travis build status](https://travis-ci.org/tomasokal/rtist.svg?branch=master)](https://travis-ci.org/tomasokal/rtist) 22 | [![Dependencies](https://tinyverse.netlify.com/badge/rtist)](https://cran.r-project.org/package=rtist) 23 | [![CRAN status](http://www.r-pkg.org/badges/version/rtist)](https://cran.r-project.org/package=rtist) 24 | [![Downloads](http://cranlogs.r-pkg.org/badges/rtist?color=brightgreen)](http://www.r-pkg.org/pkg/rtist) 25 | 26 | ## Overview 27 | 28 | "They'll sell you thousands of greens. Veronese green and emerald green and cadmium green and any sort of green you like; but that particular green, never." - *Pablo Picasso, (1966)* 29 | 30 | Use the palettes of famous artists in your own visualizations. 31 | 32 | ## Installation 33 | 34 | Install from CRAN or from Github. 35 | 36 | ``` {r, eval = FALSE} 37 | # Using install.packages(). 38 | install.packages("rtist") 39 | 40 | # Install remotes to download. 41 | install.packages("remotes") 42 | 43 | # And then install from github. 44 | remotes::install_github("tomasokal/rtist") 45 | ``` 46 | 47 | You can also use `rtist` through Emil Hvitfeldt's popular [`paletteer`](https://github.com/EmilHvitfeldt/paletteer) package. 48 | 49 | ## Palettes 50 | 51 | `rtist` provides color palettes from famous artists and paintings. You can quickly view and see all possible palettes using `rtist_help()`. 52 | 53 | ``` {r help} 54 | # Load package 55 | library(rtist) 56 | 57 | # Display possible palettes 58 | rtist::rtist_help() 59 | ``` 60 | 61 | There are 15 palettes total. 62 | 63 | ``` {r palette, fig.height = 5, echo = FALSE} 64 | library(rtist) 65 | par(mfrow=c(5,3)) 66 | for(i in names(rtist_palettes)) print(rtist_palette(i)) 67 | ``` 68 | 69 | After finding a palette, go ahead and select that palette along with however many colors you want. 70 | 71 | ``` {r palettes, eval = FALSE} 72 | # Load package 73 | library(rtist) 74 | 75 | # Choose Warhol 76 | rtist::rtist_palette("warhol") 77 | 78 | # Choose 4 colors from Picasso 79 | rtist::rtist_palette("picasso", 4) 80 | ``` 81 | 82 | ```{r ggplot, echo = FALSE} 83 | library(ggplot2) 84 | library(rtist) 85 | 86 | pal <- rtist::rtist_palette("hopper") 87 | 88 | ggplot2::ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) + 89 | geom_jitter(size = 3) + 90 | theme_minimal() + 91 | scale_color_manual(values = pal) 92 | ``` 93 | 94 | ## Credits 95 | 96 | This package was mostly built to teach me package development. It was largely inspired by Ewen Henderson’s [`ghibli`](https://github.com/ewenme/ghibli) package and Karthik Ram’s [`wesanderson`](https://github.com/karthik/wesanderson) package. 97 | 98 | The palettes themselves come from [10 Color Palettes Based on Famous Paintings](http://www.skellermeyerdesigns.com/blog/10-color-palettes-based-on-famous-paintings) and [Color Lisa](http://colorlisa.com/). Check those out for other awesome palettes. 99 | 100 | 101 | 102 | 103 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | # rtist 5 | 6 | [![Travis build 7 | status](https://travis-ci.org/tomasokal/rtist.svg?branch=master)](https://travis-ci.org/tomasokal/rtist) 8 | [![Dependencies](https://tinyverse.netlify.com/badge/rtist)](https://cran.r-project.org/package=rtist) 9 | [![CRAN 10 | status](http://www.r-pkg.org/badges/version/rtist)](https://cran.r-project.org/package=rtist) 11 | [![Downloads](http://cranlogs.r-pkg.org/badges/rtist?color=brightgreen)](http://www.r-pkg.org/pkg/rtist) 12 | 13 | ## Overview 14 | 15 | “They’ll sell you thousands of greens. Veronese green and emerald green 16 | and cadmium green and any sort of green you like; but that particular 17 | green, never.” - *Pablo Picasso, (1966)* 18 | 19 | Use the palettes of famous artists in your own visualizations. 20 | 21 | ## Installation 22 | 23 | Install from CRAN or from Github. 24 | 25 | ``` r 26 | # Using install.packages(). 27 | install.packages("rtist") 28 | 29 | # Install remotes to download. 30 | install.packages("remotes") 31 | 32 | # And then install from github. 33 | remotes::install_github("tomasokal/rtist") 34 | ``` 35 | 36 | You can also use `rtist` through Emil Hvitfeldt’s popular 37 | [`paletteer`](https://github.com/EmilHvitfeldt/paletteer) package. 38 | 39 | ## Palettes 40 | 41 | `rtist` provides color palettes from famous artists and paintings. You 42 | can quickly view and see all possible palettes using `rtist_help()`. 43 | 44 | ``` r 45 | # Load package 46 | library(rtist) 47 | 48 | # Display possible palettes 49 | rtist::rtist_help() 50 | #> rtist Painting Artist 51 | #> 1 raphael Saint Catherine of Alexandria Raphael 52 | #> 2 hokusai Great Wave off Kanagawa Hokusai 53 | #> 3 vermeer Girl with a Pearl Earring Johannes Vermeer 54 | #> 4 degas L Etoile Edgar Degas 55 | #> 5 davinci Mona Lisa Leonardo Da Vinci 56 | #> 6 vangogh Starry Night Vincent Van Gogh 57 | #> 7 hopper Nighthawks Edward Hopper 58 | #> 8 klimt The Kiss Gustav Klimt 59 | #> 9 rembrandt The Nightwatch Rembrandt 60 | #> 10 munch The Scream Edward Munch 61 | #> 11 warhol Flower, 1964 Andy Warhol 62 | #> 12 okeeffe Abstraction Blue Georgia O'Keeffe 63 | #> 13 oldenburg Red Tights with Fragment 9 Claes Oldenburg 64 | #> 14 picasso The Dream Pablo Picasso 65 | #> 15 pollock Number 1 Jackson Pollock 66 | ``` 67 | 68 | There are 15 palettes total. 69 | 70 | 71 | 72 | After finding a palette, go ahead and select that palette along with 73 | however many colors you want. 74 | 75 | ``` r 76 | # Load package 77 | library(rtist) 78 | 79 | # Choose Warhol 80 | rtist::rtist_palette("warhol") 81 | 82 | # Choose 4 colors from Picasso 83 | rtist::rtist_palette("picasso", 4) 84 | ``` 85 | 86 | 87 | 88 | ## Credits 89 | 90 | This package was mostly built to teach me package development. It was 91 | largely inspired by Ewen Henderson’s 92 | [`ghibli`](https://github.com/ewenme/ghibli) package and Karthik Ram’s 93 | [`wesanderson`](https://github.com/karthik/wesanderson) package. 94 | 95 | The palettes themselves come from [10 Color Palettes Based on Famous 96 | Paintings](http://www.skellermeyerdesigns.com/blog/10-color-palettes-based-on-famous-paintings) 97 | and [Color Lisa](http://colorlisa.com/). Check those out for other 98 | awesome palettes. 99 | -------------------------------------------------------------------------------- /R/colours.R: -------------------------------------------------------------------------------- 1 | #' Complete list of palettes. 2 | #' 3 | #' Use \code{\link{rtist_palette}} to construct palettes of desired length. 4 | #' 5 | #' @export 6 | 7 | rtist_palettes <- list(raphael = c("#FBE6C0", "#6B502C", "#BF2A1D", "#666581", "#E5A55E"), 8 | hokusai = c("#7F9DA7", "#C1B8AA", "#DDD4C6", "#0C2348", "#454A4D"), 9 | vermeer = c("#0A030A", "#4A5CA5", "#CDB87E", "#896134", "#70211B"), 10 | degas = c("#7A654E", "#E9CBB7", "#AC713B", "#78818D", "#352E23"), 11 | davinci = c("#000206", "#EFC775", "#2B2D18", "#5C7346", "#5A3A22"), 12 | vangogh = c("#010406", "#1E5880", "#FCCF49", "#F6E38E", "#A0C99C"), 13 | hopper = c("#772F19", "#EAE48D", "#629073", "#0F2732", "#1B2320"), 14 | klimt = c("#7D6A3C", "#C7AB52", "#779153", "#8F7581", "#B6634E"), 15 | rembrandt = c("#030504", "#F4DD9B", "#811D08", "#1E1507", "#252823"), 16 | munch = c("#D03908", "#193236", "#7E724C", "#B8A463", "#DA7618"), 17 | warhol = c("#F26386", "#F588AF", "#A4D984", "#FCBC52", "#FD814E"), 18 | okeeffe = c("#0E122D", "#182044", "#51628E", "#91A1BA", "#AFD0C9"), 19 | oldenburg = c("#95B1C9", "#263656", "#698946", "#F8D440", "#C82720"), 20 | picasso = c("#4E7989", "#A9011B", "#E4A826", "#80944E", "#DCD6B2"), 21 | pollock = c("#D89CA9", "#1962A0", "#F1ECD7", "#E8C051", "#1A1C23") 22 | ) 23 | 24 | #' Artist and painting palette generator 25 | #' 26 | #' Pick an artist name and number of colors desired. 27 | #' 28 | #' @param n Number of colors desired. All palettes have 5 colors. Most color schemes are derived from \href{http://www.skellermeyerdesigns.com/blog/10-color-palettes-based-on-famous-paintings}{10 Color Palettes Based on Famous Paintings}. If omitted, will use all colors. 29 | #' @param artist Name of desired artist palette. Choices are: 30 | #' \code{raphael}, \code{hokusai}, \code{vermeer}, \code{degas}, \code{davinci}, \code{vangogh}, \code{hopper}, \code{klimt}, \code{rembrandt}, \code{munch}, \code{okeeffe}, \code{warhol}, \code{oldenburg}, \code{picasso}, \code{pollock} 31 | #' @importFrom graphics rect par image text 32 | #' @importFrom grDevices rgb 33 | #' @return A vector of colors. 34 | #' @export 35 | #' @keywords color colors colour colours palette art 36 | #' @examples 37 | #' rtist_palette("warhol") 38 | #' rtist_palette("pollock", 4) 39 | 40 | rtist_palette <- function(artist, n) { 41 | 42 | plt <- rtist_palettes[[artist]] 43 | 44 | if (is.null(plt)) 45 | 46 | stop("Unfortunately, that artist has not been added yet.") 47 | 48 | if (missing(n)) { 49 | 50 | n <- length(plt) 51 | 52 | } 53 | 54 | if (n > length(plt)) { 55 | 56 | stop("Unfortunately, the number of requested colors is greater than what is included. Please decrease to 5 or less to continue.") 57 | 58 | } 59 | 60 | out <- plt[1:n] 61 | 62 | structure(out, class = "palette", name = toupper(artist)) 63 | 64 | } 65 | 66 | #' @export 67 | #' @importFrom graphics rect par image text 68 | #' @importFrom grDevices rgb 69 | 70 | print.palette <- function(x, ...) { 71 | 72 | n <- length(x) 73 | 74 | old <- par(mar = c(0.5, 0.5, 0.5, 0.5)) 75 | 76 | on.exit(par(old)) 77 | 78 | image(1:n, 79 | 1, 80 | as.matrix(1:n), 81 | col = x, 82 | ylab = "", 83 | xaxt = "n", 84 | yaxt = "n", 85 | bty = "n") 86 | 87 | rect(0, 0.9, n + 1, 1.1, 88 | col = rgb(1, 1, 1, 0.8), 89 | border = NA) 90 | 91 | text((n + 1) / 2, 92 | 1, 93 | labels = attr(x, "name"), 94 | cex = 3, 95 | col = "#32373D", 96 | family = "mono") 97 | 98 | } 99 | --------------------------------------------------------------------------------