Title: | Access Color Names Using a Standardized Nomenclature |
Version: | 0.1.2 |
Description: | A curated set of colors that are called using a standardized syntax: saturation + hue + lightness. For example, "brightblue4" and "mutedred2". Functions exists to return individual colors by name or to build palettes across or within hues. Most functions allow you to visualize the palettes in addition to returning the desired hex codes. |
URL: | https://github.com/rjake/simplecolors |
BugReports: | https://github.com/rjake/simplecolors/issues |
Imports: | colorspace, dplyr, forcats, ggplot2, magrittr, stats, stringr |
Suggests: | knitr, rmarkdown, testthat, covr, devtools, spelling |
Depends: | R (≥ 3.1.0) |
License: | GPL-2 | GPL-3 [expanded from: GNU General Public License] |
VignetteBuilder: | knitr |
Language: | en-US |
LazyData: | true |
RoxygenNote: | 7.2.3 |
Encoding: | UTF-8 |
NeedsCompilation: | no |
Packaged: | 2023-08-31 04:21:25 UTC; foxtr |
Author: | Jake Riley [aut, cre] |
Maintainer: | Jake Riley <rjake@sas.upenn.edu> |
Repository: | CRAN |
Date/Publication: | 2023-08-31 04:40:07 UTC |
simplecolors: A package for accessing color names using a standardized nomenclature
Description
The simplecolors package provides two categories of functions: color names and color palettes
Color names
The sc() function is the main way to access color names. Colors can be called by including them as comma separated string values. For example: sc("brightblue4", "mutedred2")
Color palettes
There are several functions that are prefixed with "sc_". These generate palettes of colors and can return hex codes (default), a table, or a plot showing the colors selected.
Author(s)
Maintainer: Jake Riley rjake@sas.upenn.edu
See Also
Useful links:
Table of available colors
Description
This is a list of simplified color names
Usage
color_table
Format
A data frame with 200 observations and 15 variables
- H360
hue on a 0-360 scale
- L1
lightness on a 0-1 scale
- S1
saturation on a 0-1 scale
- light
the light value used in the package, 0-7
- color
the base color name (hue), red, cyan, etc.
- letter
the first letter of the color, for building palettes
- sat
the saturation value used in the package, "bright", "muted", "dull", or blank ""
- color_sat
the color + the saturation, ex: "brightblue", "dullred"
- color_name
the final unique name: color_sat + lightness, ex: "brightblue2", "mutedorange3"
- H1
hue on a 0-1 scale
- hex
the hex code of the color
- R
the red of the RGB value
- G
the green of the RGB value
- B
the blue of the RGB value
- H255
for convenience as some HLS selection tools use a 0-255 scale
Objects exported from other packages
Description
These objects are imported from other packages. Follow the links below to see their documentation.
- magrittr
Specify color(s) by name
Description
Specify color(s) by name
Usage
sc(...)
Arguments
... |
the unique color names used in the package, ex: "brightred5", "grey4", "dullblue2" |
Examples
sc("violet4", "brightteal3")
Generates a palette within across hues
Description
Generates a palette within across hues
Usage
sc_across(palette = "ROYGTBVPGy", light = 3, sat = "", return = NULL)
Arguments
palette |
the first letter of each hue to include |
light |
the lightness value to hold constant (1:7) |
sat |
the saturation value to hold constant ("bright", "muted", "dull", "") |
return |
defaults to returning hex codes but can also return a table or plot of the generated palette |
See Also
Other palettes:
sc_within()
Examples
sc_across(palette = "BO")
sc_across(palette = "BO", sat = "bright", return = "table")
sc_across(palette = "BO", sat = "bright", return = "plot")
sc_across(palette = "RBTVPGy", light = 4, return = "plot")
Generates a palette within 1 hue
Description
Generates a palette within 1 hue
Usage
sc_within(hue, light = c(2:5), sat = "", return = NULL)
sc_red(light = 2:5, sat = "", return = NULL)
sc_orange(light = 2:5, sat = "", return = NULL)
sc_yellow(light = 2:5, sat = "", return = NULL)
sc_green(light = 2:5, sat = "", return = NULL)
sc_teal(light = 2:5, sat = "", return = NULL)
sc_blue(light = 2:5, sat = "", return = NULL)
sc_violet(light = 2:5, sat = "", return = NULL)
sc_pink(light = 2:5, sat = "", return = NULL)
sc_grey(light = 2:5, sat = "", return = NULL)
Arguments
hue |
ex: "red", "blue", "violet" |
light |
the lightness of the color, ex: 1:5 |
sat |
the saturation of the color, ex: "bright", "muted", "dull" or "" (base) |
return |
defaults to returning hex codes but can also return a table or plot of the generated palette |
See Also
Other palettes:
sc_across()
Examples
sc_within("violet", 1:3)
sc_within("violet", 1:5, "bright" , return = "table")
sc_within("violet", 2:4, c("bright", "muted"), return = "plot")
Show all available colors
Description
Plots all available color values.
Usage
show_colors(labels = FALSE)
Arguments
labels |
logical TRUE (default) will plot the color with color names, FALSE will plot the colors only |
Details
Labels can be added by using the argument labels = TRUE
Value
Returns a plot object
ggplot
Examples
show_colors()