| Title: | A Set of Color Palettes Inspired by OK Go Music Videos for 'ggplot2' in R |
|---|---|
| Description: | A collection of aesthetically appealing color palettes for effective data visualization with 'ggplot2'. Palettes support both discrete and continuous data. |
| Authors: | Nelson de O. Quesado Filho [aut, cre], Ana Flávia Teles Silveira [aut] |
| Maintainer: | Nelson de O. Quesado Filho <[email protected]> |
| License: | GPL-3 |
| Version: | 0.1.1 |
| Built: | 2026-05-13 05:41:42 UTC |
| Source: | https://github.com/nelsonquesado/okcolors |
Returns a vector of 'n' colors from a specified palette included in the okcolors package.
okcolors(palette = "obsession", n = 5, direction = 1)okcolors(palette = "obsession", n = 5, direction = 1)
palette |
Character. Name of the palette to use. One of '"it"', '"stone"', '"skyscrapers"', '"obsession"', or '"moment"'. Default is '"obsession"'. |
n |
Integer. Number of colors to return. Default is '5'. |
direction |
Integer. If '1' (default), returns the palette as is. If '-1', reverses the order. |
A character vector of hex color codes of length 'n'.
okcolors("stone", 3) okcolors("obsession", 7, direction = -1)okcolors("stone", 3) okcolors("obsession", 7, direction = -1)
Applies a custom discrete or continuous color scale to ggplot2 plots using a selected palette from the okcolors package.
scale_color_okcolors( palette = "obsession", discrete = TRUE, direction = 1, ... )scale_color_okcolors( palette = "obsession", discrete = TRUE, direction = 1, ... )
palette |
Character. Name of the palette to use. Must be one of the palettes available in 'okcolors()'. Default is '"obsession"'. |
discrete |
Logical. Whether to use a discrete scale ('TRUE') or a continuous scale ('FALSE'). Default is 'TRUE'. |
direction |
Integer. If '1' (default), colors are as defined. If '-1', the palette is reversed. |
... |
Additional arguments passed to 'ggplot2::discrete_scale()' or 'ggplot2::scale_color_gradientn()'. |
A 'Scale' object that can be added to a ggplot2 plot.
Applies a custom discrete or continuous fill scale to ggplot2 plots using a selected palette from the okcolors package.
scale_fill_okcolors(palette = "obsession", discrete = TRUE, direction = 1, ...)scale_fill_okcolors(palette = "obsession", discrete = TRUE, direction = 1, ...)
palette |
Character. Name of the palette to use. Must be one of the palettes available in 'okcolors()'. Default is '"obsession"'. |
discrete |
Logical. Whether to use a discrete scale ('TRUE') or a continuous scale ('FALSE'). Default is 'TRUE'. |
direction |
Integer. If '1' (default), colors are as defined. If '-1', the palette is reversed. |
... |
Additional arguments passed to 'ggplot2::discrete_scale()' or 'ggplot2::scale_fill_gradientn()'. |
A 'Scale' object that can be added to a ggplot2 plot.
Returns a character vector of all valid palette names supported by the 'okcolors' package.
valid_palettes()valid_palettes()
A character vector with the names of available palettes.
valid_palettes()valid_palettes()