| Title: | Color Palettes Inspired by Glyos Colorways |
|---|---|
| Description: | Color palettes based on the named colorways of the Glyos toy system: Onell Design's Glyos System Series and the Glyos-compatible lines from partner companies such as TheGodBeast, Spy Monkey Creations, Toyfinity and the Four Horsemen. Includes 'ggplot2' color and fill scales for discrete and continuous data, metadata linking each palette to its company and product line, helpers to shortlist palettes that suit categorical, color-blind-safe, sequential or diverging use, and tools to combine palettes (one color per colorway) or pick the most distinguishable colors from a pool for a light, dark or grayscale plot. Hex values are approximations curated from product photography. This is a fan project and is not affiliated with or endorsed by any of the companies. |
| Authors: | Brian Maitner [aut, cre] |
| Maintainer: | Brian Maitner <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.3.0 |
| Built: | 2026-10-28 00:00:58 UTC |
| Source: | https://github.com/cran/glyospalettes |
Background information for every palette in glyos_palettes: the company and product line it comes from, the colorway name as the manufacturer uses it, the year and wave of the reference release where known, a plain-language description of the colors, the reference figure whose photograph the palette was sampled from, and a link to that figure's entry in the Official Glyos Database (Onell Design) or the Glyos Wiki (partner companies).
glyos_colorwaysglyos_colorways
A data frame with one row per palette and the columns:
Palette name, as used by glyos_palette().
Company that produced the colorway, e.g. "Onell Design"
or "TheGodBeast". See glyos_companies().
Product line, e.g. "Glyos", "Kabuto Mushi" or
"Battle Tribes".
Colorway or figure name as used by the manufacturer.
Year of the reference release, or NA where not recorded.
Release wave or series of the reference release, or NA.
Number of colors in the palette.
Description of the plastic and paint colors.
Figure the palette was sampled from.
URL of the reference figure's page.
Direct URL of the reference photograph the palette was sampled from, hosted by the Official Glyos Database or the Glyos Wiki.
Official Glyos Database, https://database.glyos.com/; the Glyos Transmission Web Log, https://onelldesign.blogspot.com/; and the Glyos Wiki (glyos.fandom.com).
head(glyos_colorways) table(glyos_colorways$company) subset(glyos_colorways, company == "TheGodBeast", c(palette, colorway))head(glyos_colorways) table(glyos_colorways$company) subset(glyos_colorways, company == "TheGodBeast", c(palette, colorway))
Takes one color from each named palette, or from every palette of a company or product line, and returns them as a single categorical palette named by the colorway each color came from. This is the quick way to get "one color per Kabuto Mushi" or "one color per Battle Tribes figure".
glyos_combine( palettes = NULL, company = NULL, line = NULL, which = 1L, distinct = FALSE )glyos_combine( palettes = NULL, company = NULL, line = NULL, which = 1L, distinct = FALSE )
palettes |
Character vector of palette names; see
|
company, line
|
Optional filters passed to |
which |
Which color to take from each palette (1 is the main plastic color). Palettes with fewer colors contribute their last one. |
distinct |
Logical. Choose each palette's contribution to be as
different as possible from those already chosen, instead of position
|
By default the first color of each palette is used, which is the main
plastic color and so is faithful to each figure but can repeat across a
line cast from shared plastics. distinct = TRUE instead picks, for each
palette in turn, the color from that palette that is farthest (in CIE
Lab) from the colors already chosen, which keeps the result legible on a
chart at some cost to fidelity. For a stricter selection that also drops
colors with poor contrast against the background, see glyos_pick().
A named character vector of hex colors with class
"glyos_palette", one per palette, in the order of palettes or of
glyos_palette_names(). Pass unname()d to
ggplot2::scale_colour_manual().
glyos_combine(c("standard", "spectre", "hades", "infection", "glyaxia")) glyos_combine(line = "Kabuto Mushi") glyos_combine(line = "Kabuto Mushi", distinct = TRUE) glyos_combine(company = "Toyfinity", which = 2) library(ggplot2) ggplot(mpg, aes(displ, hwy, color = drv)) + geom_point(size = 2.5) + scale_colour_manual(values = unname(glyos_combine(c("glyaxia", "hades", "infection"))))glyos_combine(c("standard", "spectre", "hades", "infection", "glyaxia")) glyos_combine(line = "Kabuto Mushi") glyos_combine(line = "Kabuto Mushi", distinct = TRUE) glyos_combine(company = "Toyfinity", which = 2) library(ggplot2) ggplot(mpg, aes(displ, hwy, color = drv)) + geom_point(size = 2.5) + scale_colour_manual(values = unname(glyos_combine(c("glyaxia", "hades", "infection"))))
List the companies with palettes in glyospalettes
glyos_companies()glyos_companies()
A character vector of company names, sorted with Onell Design
first, that can be passed to the company argument of
glyos_palette_names() and glyos_show_palettes().
glyos_companies()glyos_companies()
Builds a short attribution sentence naming the colorways used and the companies that designed them, suitable for a figure caption or an acknowledgments section. Naming the designer of a color scheme is ordinary factual attribution; the longer form also states that the colors are approximations and imply no endorsement, which is the wording journals tend to want.
glyos_credit( x, format = c("caption", "acknowledgment", "markdown"), package = TRUE )glyos_credit( x, format = c("caption", "acknowledgment", "markdown"), package = TRUE )
x |
What to credit: a palette name, a character vector of names, or a
|
format |
One of:
|
package |
Logical. Mention the glyospalettes package? Set to |
A single character string.
glyos_colorways for the underlying metadata;
citation("glyospalettes") for the package reference.
glyos_credit("kots_vice_knight") glyos_credit(c("glyaxia", "hades", "kabuto_infection")) glyos_credit(glyos_pick(c("glyaxia", "kabuto_infection"), n = 4)) glyos_credit("glyaxia", format = "acknowledgment") cat(glyos_credit(c("glyaxia", "wom_empyreus"), format = "markdown")) library(ggplot2) ggplot(mpg, aes(displ, hwy, color = drv)) + geom_point(size = 2.5) + scale_color_glyos("glyaxia") + labs(caption = glyos_credit("glyaxia"))glyos_credit("kots_vice_knight") glyos_credit(c("glyaxia", "hades", "kabuto_infection")) glyos_credit(glyos_pick(c("glyaxia", "kabuto_infection"), n = 4)) glyos_credit("glyaxia", format = "acknowledgment") cat(glyos_credit(c("glyaxia", "wom_empyreus"), format = "markdown")) library(ggplot2) ggplot(mpg, aes(displ, hwy, color = drv)) + geom_point(size = 2.5) + scale_color_glyos("glyaxia") + labs(caption = glyos_credit("glyaxia"))
Filters the palettes to those whose colors work for a given job, judged
from the perceptual statistics in glyos_palette_stats(). Many colorways
look great on a figure but poor on a chart; this surfaces the ones that
hold up.
glyos_find_palettes( use = c("categorical", "colorblind", "sequential", "diverging"), company = NULL, line = NULL, min_colours = 4 )glyos_find_palettes( use = c("categorical", "colorblind", "sequential", "diverging"), company = NULL, line = NULL, min_colours = 4 )
use |
One of:
The thresholds are deliberately simple heuristics computed by
|
company, line
|
Optional filters passed to |
min_colours |
Minimum number of colors the palette must have. |
A character vector of palette names, ordered so that the strongest candidates for the use case come first.
glyos_find_palettes("colorblind") glyos_find_palettes("diverging", company = "Onell Design") glyos_find_palettes("sequential")glyos_find_palettes("colorblind") glyos_find_palettes("diverging", company = "Onell Design") glyos_find_palettes("sequential")
Returns n colors from the named colorway, either the first n curated
colors (type = "discrete") or n colors interpolated across the whole
palette (type = "continuous").
glyos_palette( name, n = NULL, type = c("discrete", "continuous"), strict = TRUE, sort = FALSE )glyos_palette( name, n = NULL, type = c("discrete", "continuous"), strict = TRUE, sort = FALSE )
name |
Palette name. Case-insensitive; see |
n |
Number of colors wanted. Defaults to every color in the palette. |
type |
Either |
strict |
Logical. For discrete palettes, error when |
sort |
Logical. If |
A character vector of hex colors with class "glyos_palette", which
has a print method that draws the swatches.
glyos_palette("spectre") glyos_palette("glyaxia", 3) glyos_palette("hades", 12, type = "continuous") glyos_palette("hades", 12, type = "continuous", sort = TRUE) glyos_palette("wom_empyreus") # base graphics barplot(1:5, col = glyos_palette("gatekeeper"))glyos_palette("spectre") glyos_palette("glyaxia", 3) glyos_palette("hades", 12, type = "continuous") glyos_palette("hades", 12, type = "continuous", sort = TRUE) glyos_palette("wom_empyreus") # base graphics barplot(1:5, col = glyos_palette("gatekeeper"))
List the available Glyos palettes
glyos_palette_names(company = NULL, line = NULL)glyos_palette_names(company = NULL, line = NULL)
company |
Optional company name (see |
line |
Optional product line (see the |
A character vector of palette names accepted by glyos_palette()
and the scale_*_glyos() functions.
glyos_palette_names() glyos_palette_names(company = "TheGodBeast") glyos_palette_names(line = "Battle Tribes")glyos_palette_names() glyos_palette_names(company = "TheGodBeast") glyos_palette_names(line = "Battle Tribes")
Computes, from the hex colors alone, how suitable each palette is for the
common plotting jobs. Used by glyos_find_palettes(); exposed so you can
apply your own thresholds.
glyos_palette_stats(names = glyos_palette_names())glyos_palette_stats(names = glyos_palette_names())
names |
Palette names to compute for. Defaults to all palettes. |
Distances are CIE76 (Euclidean in CIE Lab). Color-vision deficiency is simulated with the Machado, Oliveira and Fernandes (2009) matrices at full severity for deuteranopia, protanopia and tritanopia. Hue statistics only consider colors with chroma of at least 20, so grays and blacks do not count as a hue.
A data frame with one row per palette and the columns:
Palette name.
Number of colors.
Smallest pairwise Lab distance between any two colors. Larger is easier to tell apart; 20 is a comfortable floor for categorical use.
The same after simulating each color-vision deficiency.
Range of CIE lightness (0 to 100) across the palette.
Angular spread of the chromatic colors' hues, in degrees. Near 0 means one hue family.
Number of distinct hue families (hues separated by more than 60 degrees).
Whether the palette contains a light or neutral color that can serve as a midpoint.
Logical flags as
used by glyos_find_palettes().
s <- glyos_palette_stats() head(s[order(-s$min_de_deutan), c("palette", "min_de", "min_de_deutan")])s <- glyos_palette_stats() head(s[order(-s$min_de_deutan), c("palette", "min_de", "min_de_deutan")])
A named list of color palettes, one per colorway, covering Onell Design's
Glyos line and the Glyos-compatible lines from partner companies such as
TheGodBeast, Spy Monkey Creations, Toyfinity and the Four Horsemen. Each
element is a character vector of two to six hex colors holding only the
plastic and paint colors of that colorway, ordered so that the first few
colors are the most distinct from one another (body color first, then
secondary plastic, then paint accents). Use glyos_palette() to pull colors
from a palette and glyos_colorways for background on each colorway,
including which company made it.
glyos_palettesglyos_palettes
A named list of character vectors of hex colors.
Hex values are approximations. Onell Design palettes were sampled from the reference product photograph in the Official Glyos Database (https://database.glyos.com/) and adjusted against Onell's published color descriptions. Partner-company palettes were sampled from the lead photograph of the figure's page on the Glyos Wiki (glyos.fandom.com). Clear, glow-in-the-dark, metallic and pearlescent plastics cannot be captured by a single flat color; those palettes reflect how the plastic photographs.
glyos_palette(), glyos_palette_names(), glyos_companies(),
glyos_colorways, glyos_show_palettes()
length(glyos_palettes) glyos_palettes$spectre glyos_palettes$kabuto_infectionlength(glyos_palettes) glyos_palettes$spectre glyos_palettes$kabuto_infection
Pools the colors of the named palettes and selects the n that are
hardest to confuse with one another on a given kind of plot: light
background, dark background, or output that will be read in grayscale.
Optionally judges distinctness under simulated color-vision deficiency.
Use it when a single colorway does not have enough usable colors, or when
you want a company's or a product line's colors but only the ones that
hold up on a chart.
glyos_pick( palettes = NULL, n = 5, style = c("light", "dark", "grayscale", "greyscale"), colorblind = FALSE, company = NULL, line = NULL, background = NULL, min_contrast = 3 )glyos_pick( palettes = NULL, n = 5, style = c("light", "dark", "grayscale", "greyscale"), colorblind = FALSE, company = NULL, line = NULL, background = NULL, min_contrast = 3 )
palettes |
Character vector of one or more palette names; see
|
n |
Number of colors wanted. |
style |
One of |
colorblind |
Logical. Require the colors to stay distinct under simulated deuteranopia, protanopia and tritanopia? |
company, line
|
Optional filters passed to |
background |
Optional background color overriding the one implied
by |
min_contrast |
Minimum WCAG 2 contrast ratio a color must have against the background to be considered. Set to 1 to disable the filter. |
The selection runs in three steps.
Pool. The colors of every palette in palettes (plus every palette
matching company and line, if given) are combined, with duplicates
removed.
Filter for the background. Colors whose WCAG 2 contrast ratio
against the background is below min_contrast are dropped, so a
light-mode selection never contains a near-white and a dark-mode
selection never contains a near-black. The background is white for
"light" and "grayscale" and near-black ("#121212") for "dark"
unless background is given. The default of 3 is the WCAG minimum for
graphical objects; lower it to keep more colors, raise it for text.
Choose. Every pair of remaining colors is scored by its distance
in CIE Lab (CIE76). With colorblind = TRUE the distance is the
smallest of the normal-vision distance and the distances after
simulating deuteranopia, protanopia and tritanopia (Machado, Oliveira
and Fernandes 2009), so two colors only count as distinct if every
viewer can tell them apart. With style = "grayscale" only the
lightness difference counts, so the colors survive conversion to
gray. The n colors whose closest pair is farthest apart are chosen
(a maximum-dispersion subset, found exhaustively when the pool is
small and by greedy seeding plus swap search otherwise), then ordered
so that each color is as different as possible from those before it.
The result is a categorical palette: it does not try to build a gradient.
The smallest pairwise distance in the selection is returned as the
min_distance attribute; values above about 20 are comfortably distinct,
and below about 12 two colors will be hard to tell apart. If the pool
cannot supply n colors after filtering, the function errors and says
how many it had, so add palettes or lower min_contrast.
A character vector of n hex colors with class "glyos_palette",
named by the palette each color came from, and with attributes
min_distance (smallest pairwise distance under the chosen criterion),
style, colorblind and background.
glyos_combine() to take one color from each of a set of
palettes without filtering; glyos_find_palettes() to shortlist whole
palettes; glyos_palette_stats() for the underlying measures.
# five colors for a white-background plot, from two classic colorways glyos_pick(c("glyaxia", "hades"), n = 5) # the same for a dark theme, and color-blind safe glyos_pick(c("glyaxia", "hades"), n = 4, style = "dark", colorblind = TRUE) # a whole product line, printable in grayscale glyos_pick(line = "Kabuto Mushi", n = 4, style = "grayscale") library(ggplot2) cols <- glyos_pick(company = "Toyfinity", n = 3, colorblind = TRUE) ggplot(mpg, aes(displ, hwy, color = drv)) + geom_point(size = 2.5) + scale_colour_manual(values = unname(cols)) + theme_minimal()# five colors for a white-background plot, from two classic colorways glyos_pick(c("glyaxia", "hades"), n = 5) # the same for a dark theme, and color-blind safe glyos_pick(c("glyaxia", "hades"), n = 4, style = "dark", colorblind = TRUE) # a whole product line, printable in grayscale glyos_pick(line = "Kabuto Mushi", n = 4, style = "grayscale") library(ggplot2) cols <- glyos_pick(company = "Toyfinity", n = 3, colorblind = TRUE) ggplot(mpg, aes(displ, hwy, color = drv)) + geom_point(size = 2.5) + scale_colour_manual(values = unname(cols)) + theme_minimal()
Draws a swatch strip for each colorway on the current graphics device,
labeled with the palette name and, by default, the hex code under each
swatch. Useful for picking a colorway or for reporting a color that looks
wrong. With no arguments every palette is drawn, which is a lot; filter by
company, line or use to narrow it down.
glyos_show_palettes( names = NULL, company = NULL, line = NULL, use = NULL, ncol = 3, hex = TRUE )glyos_show_palettes( names = NULL, company = NULL, line = NULL, use = NULL, ncol = 3, hex = TRUE )
names |
Optional character vector of palette names to show. Defaults
to every palette matching |
company |
Optional company name to restrict to; see
|
line |
Optional product line to restrict to; see the |
use |
Optional use case to restrict to; see |
ncol |
Number of columns to arrange the swatch strips in. |
hex |
Logical. Print the hex code under each swatch? |
Invisibly, the character vector of palette names that were drawn.
glyos_show_palettes(company = "Onell Design") glyos_show_palettes(company = "TheGodBeast", ncol = 2) glyos_show_palettes(use = "colorblind", ncol = 4) glyos_show_palettes(c("spectre", "hades", "infection"), ncol = 1)glyos_show_palettes(company = "Onell Design") glyos_show_palettes(company = "TheGodBeast", ncol = 2) glyos_show_palettes(use = "colorblind", ncol = 4) glyos_show_palettes(c("spectre", "hades", "infection"), ncol = 1)
Color and fill scales that use a Glyos colorway palette. The _d variants
are for discrete data, the _c variants for continuous data, and
scale_colour_glyos() / scale_fill_glyos() choose between the two with
the discrete argument. scale_color_* spellings are aliases.
scale_colour_glyos_d(palette = "standard", reverse = FALSE, ...) scale_fill_glyos_d(palette = "standard", reverse = FALSE, ...) scale_colour_glyos_c(palette = "standard", reverse = FALSE, sort = FALSE, ...) scale_fill_glyos_c(palette = "standard", reverse = FALSE, sort = FALSE, ...) scale_colour_glyos( palette = "standard", discrete = TRUE, reverse = FALSE, sort = FALSE, ... ) scale_fill_glyos( palette = "standard", discrete = TRUE, reverse = FALSE, sort = FALSE, ... ) scale_color_glyos_d(palette = "standard", reverse = FALSE, ...) scale_color_glyos_c(palette = "standard", reverse = FALSE, sort = FALSE, ...) scale_color_glyos( palette = "standard", discrete = TRUE, reverse = FALSE, sort = FALSE, ... )scale_colour_glyos_d(palette = "standard", reverse = FALSE, ...) scale_fill_glyos_d(palette = "standard", reverse = FALSE, ...) scale_colour_glyos_c(palette = "standard", reverse = FALSE, sort = FALSE, ...) scale_fill_glyos_c(palette = "standard", reverse = FALSE, sort = FALSE, ...) scale_colour_glyos( palette = "standard", discrete = TRUE, reverse = FALSE, sort = FALSE, ... ) scale_fill_glyos( palette = "standard", discrete = TRUE, reverse = FALSE, sort = FALSE, ... ) scale_color_glyos_d(palette = "standard", reverse = FALSE, ...) scale_color_glyos_c(palette = "standard", reverse = FALSE, sort = FALSE, ...) scale_color_glyos( palette = "standard", discrete = TRUE, reverse = FALSE, sort = FALSE, ... )
palette |
Name of a Glyos colorway. See |
reverse |
Logical. Reverse the order of colors in the palette? |
... |
Additional arguments passed on to
|
sort |
Logical, continuous scales only. Order the palette from darkest
to lightest before building the gradient, so the scale reads as
low-to-high. See |
discrete |
Logical. If |
Discrete scales draw the first n colors of the palette, where n is the
number of levels in the data. If the data has more levels than the palette
has colors, the palette is interpolated with grDevices::colorRampPalette()
so that every level still receives a distinct color; expect the result to be
less legible than the curated colors.
A ggplot2 scale object.
library(ggplot2) ggplot(mpg, aes(displ, hwy, color = class)) + geom_point(size = 3) + scale_colour_glyos("glyaxia") ggplot(diamonds, aes(cut, fill = clarity)) + geom_bar() + scale_fill_glyos_d("gatekeeper") ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + geom_tile() + scale_fill_glyos_c("spectre")library(ggplot2) ggplot(mpg, aes(displ, hwy, color = class)) + geom_point(size = 3) + scale_colour_glyos("glyaxia") ggplot(diamonds, aes(cut, fill = clarity)) + geom_bar() + scale_fill_glyos_d("gatekeeper") ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + geom_tile() + scale_fill_glyos_c("spectre")