Title: | A Collection of Palettes and Some Functions to Help Use Them |
---|---|
Description: | A collection of color palettes that were extracted from various books on my sons(Wren) bookshelf. Also included are a number of functions and wrappers to utilize them, as well as to subset the palettes to desired number/specific colors. |
Authors: | Benjamin Uveges [aut, cre] |
Maintainer: | Benjamin Uveges <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.0 |
Built: | 2024-11-13 03:43:04 UTC |
Source: | https://github.com/buveges/wrensbookshelf |
Wrapper function to allow easy integration with ggplot2. Sets continuous color scale.
scale_color_WB_c(name, direction = 1, ...)
scale_color_WB_c(name, direction = 1, ...)
name |
Name of palette from WrensBookshelf. |
direction |
Direction you want the palette to proceed; 1 = direction shown in ShowBookshelf() or ShowBook(), -1 = reversed. |
... |
See scale_color_gradientn() for additional params. |
No return value, integrates WB_brewer into ggplot2 function.
ggplot2::ggplot(mtcars, ggplot2::aes(x=disp,y=wt, color = mpg))+ ggplot2::geom_point(size=3)+ scale_color_WB_c(name = "WhatWellBuild")
ggplot2::ggplot(mtcars, ggplot2::aes(x=disp,y=wt, color = mpg))+ ggplot2::geom_point(size=3)+ scale_color_WB_c(name = "WhatWellBuild")
Wrapper function to allow easy integration with ggplot2. Sets discrete color scale
scale_color_WB_d(name, direction = 1, override.order = FALSE, ...)
scale_color_WB_d(name, direction = 1, override.order = FALSE, ...)
name |
Name of palette from WrensBookshelf. |
direction |
Direction you want the palette to proceed; 1 = direction shown in ShowBookshelf() or ShowBook(), -1 = reversed. |
override.order |
Argument used to override the prescribed order that colors are selected from palettes for discrete palettes where n < length(palette). Default = FALSE. |
... |
See discrete_scale() for additional params. |
No return value, integrates WB_brewer into ggplot2 function.
ggplot2::ggplot(mtcars, ggplot2::aes(x = disp,y = wt, color = factor(cyl)))+ ggplot2::geom_point(size=3)+ scale_color_WB_d(name = "YouMatter")
ggplot2::ggplot(mtcars, ggplot2::aes(x = disp,y = wt, color = factor(cyl)))+ ggplot2::geom_point(size=3)+ scale_color_WB_d(name = "YouMatter")
Wrapper function to allow easy integration with ggplot2. Sets continuous fill scale.
scale_fill_WB_c(name, direction = 1, ...)
scale_fill_WB_c(name, direction = 1, ...)
name |
Name of palette from WrensBookshelf. |
direction |
Direction you want the palette to proceed; 1 = direction shown in ShowBookshelf() or ShowBook(), -1 = reversed. |
... |
See scale_color_gradientn() for additional params. |
No return value, integrates WB_brewer into ggplot2 function.
ggplot2::ggplot(mtcars, ggplot2::aes(x = disp,y = wt, fill= mpg))+ ggplot2::geom_point(size=3, shape = 21)+ scale_fill_WB_c(name = "WhatWellBuild")
ggplot2::ggplot(mtcars, ggplot2::aes(x = disp,y = wt, fill= mpg))+ ggplot2::geom_point(size=3, shape = 21)+ scale_fill_WB_c(name = "WhatWellBuild")
Wrapper function to allow easy integration with ggplot2. Sets discrete color scale.
scale_fill_WB_d(name, direction = 1, override.order = FALSE, ...)
scale_fill_WB_d(name, direction = 1, override.order = FALSE, ...)
name |
Name of palette from WrensBookshelf. |
direction |
Direction you want the palette to proceed; 1 = direction shown in ShowBookshelf() or ShowBook(), -1 = reversed. |
override.order |
Argument used to override the prescribed order that colors are selected from palettes for discrete palettes where n < length(palette). Default = FALSE. |
... |
See discrete_scale() for additional params. |
No return value, integrates WB_brewer into ggplot2 function.
ggplot2::ggplot(mtcars, ggplot2::aes(x = disp,y = wt, fill = factor(cyl)))+ ggplot2::geom_point(size = 3, shape = 21)+ scale_fill_WB_d(name = "YouMatter")
ggplot2::ggplot(mtcars, ggplot2::aes(x = disp,y = wt, fill = factor(cyl)))+ ggplot2::geom_point(size = 3, shape = 21)+ scale_fill_WB_d(name = "YouMatter")
Generates a graphic object using a specified palette from WrensBookshelf.
ShowBook(name)
ShowBook(name)
name |
Name of desired palette. |
Graphic object.
ShowBook(name ="BabyWrenAndTheGreatGift")
ShowBook(name ="BabyWrenAndTheGreatGift")
Generates a graphic object with desired subset of palettes from WrensBookshelf.
ShowBookshelf(CVDsafe = FALSE, BestFor = NA)
ShowBookshelf(CVDsafe = FALSE, BestFor = NA)
CVDsafe |
Argument used to restrict displayed palettes to those that are color vision deficiency (CVD) safe. Default is FALSE, set to TRUE to enact filter. |
BestFor |
Argument used to restrict displayed palettes to those that are best for either continuous or discrete data types. Arguments are "discrete" or "continuous" |
Graphic object.
ShowBookshelf() ShowBookshelf(CVDsafe = TRUE, BestFor = "continuous")
ShowBookshelf() ShowBookshelf(CVDsafe = TRUE, BestFor = "continuous")
Function used to create continuous/discrete palettes using the palettes in WrensBookshelf.
WB_brewer( name, n, type = c("discrete", "continuous"), direction = c(1, -1), override.order = FALSE )
WB_brewer( name, n, type = c("discrete", "continuous"), direction = c(1, -1), override.order = FALSE )
name |
Name of palette from WrensBookshelf |
n |
Number of colors to select, or size of continuous palette if n > length(palette) |
type |
Type of palette you wish to generate ("continuous" or "discrete") |
direction |
Direction you want the palette to proceed; 1 = direction shown in ShowBookshelf() or ShowBook(), -1 = reversed. |
override.order |
Argument used to override the prescribed order that colors are selected from palettes for discrete palettes where n < length(palette). Default = FALSE. |
A color palette.
WB_brewer(name = "BabyWrenAndTheGreatGift", type = "continuous", n = 200) WB_brewer(name = "JulienIsAMermaid", type = "discrete", direction = -1, n = 7, override.order = TRUE)
WB_brewer(name = "BabyWrenAndTheGreatGift", type = "continuous", n = 200) WB_brewer(name = "JulienIsAMermaid", type = "discrete", direction = -1, n = 7, override.order = TRUE)
Function used to create customized continuous/discrete palettes using the palettes in WrensBookshelf, offering more specific control over selected colors than WB_brewer.
WB_subset_brewer( name, n = NA, LCR, type = c("continuous", "discrete"), direction = c(1, -1), n2 = NULL )
WB_subset_brewer( name, n = NA, LCR, type = c("continuous", "discrete"), direction = c(1, -1), n2 = NULL )
name |
Name of palette from WrensBookshelf. |
n |
Number of colors to select/subset. |
LCR |
Location from which you want select n colors from in specified palette ("left","right", "center"). Can also use a vector of specific color numbers within palette (e.g. c(1,4,7)) |
type |
Type of palette you wish to generate ("continuous" or "discrete") |
direction |
Direction you want the palette to proceed; 1 = direction shown in ShowBookshelf() or ShowBook(), -1 = reversed. |
n2 |
If type = "continuous", length of palette to generate. |
Color palette.
WB_subset_brewer(name = "JulienIsAMermaid", n = 5, LCR = "left", type = "continuous", n2 = 200) WB_subset_brewer(name = "WhereTheWildThingsAre", type = "discrete", LCR = c(1,4,5,6))
WB_subset_brewer(name = "JulienIsAMermaid", n = 5, LCR = "left", type = "continuous", n2 = 200) WB_subset_brewer(name = "WhereTheWildThingsAre", type = "discrete", LCR = c(1,4,5,6))
Use names(WrensBookshelf) to display all possible palette names. Current available palettes:
BabyBeluga
, BabyWrenAndTheGreatGift
, BlueberriesForSal
, BoTheBrave
,
BoTheBraveCVDS
, BurtDow
, BurtDowCVDS
, CapsForSale
,FletcherAndTheFallingLeaves
,
Friends
, GoodnightGoodnightConstructionSite
, GustavoTheShyGhost1
,
GustavoTheShyGhost2
, HaroldAndThePurpleCrayon
, JeffGoesWild
, JulienIsAMermaid
,
KnightOwl
, LittleBlueHouseBesideTheSeaCont
, LittleBlueHouseBesideTheSeaDisc
,
Madelline
, MakeWayForDucklings
, MoreThanALittle
, OhThePlacesYoullGo
,
Opposites
, SleepTightFarm1
, SleepTightFarm2
, StackTheCats
,
TheDucklingGetsACookie
, TheHoneybee
, TheHoneybeeDiverging
, ThePoutPoutFish
,
TheRealBoat1
, TheRealBoat2
, TheSnowyDay
, TheStoryOfBabar
,
TheseWordsIShapedForYou
, ThisMooseBelongsToMe
, ThreeLittleVikings
, TigerDays
,
TinyPerfectThings
, TooCrowded
, Vampenguin
, WhatWellBuild
, WhereTheWildThingsAre
, and YouMatter
.
WrensBookshelf
WrensBookshelf
An object of class list
of length 50.
No return value, sets a list of palettes to be used with WrensBookshelf functions