A Toolbox for Manipulating and Assessing Colors and Palettes

Carries out mapping between assorted color spaces including RGB, HSV, HLS, CIEXYZ, CIELUV, HCL (polar CIELUV), CIELAB and polar CIELAB. Qualitative, sequential, and diverging color palettes based on HCL colors are provided along with corresponding ggplot2 color scales. Color palette choice is aided by an interactive app (with either a Tcl/Tk or a shiny GUI) and shiny apps with an HCL color picker and a color vision deficiency emulator. Plotting functions for displaying and assessing palettes include color swatches, visualizations of the HCL space, and trajectories in HCL and/or RGB spectrum. Color manipulation functions include: desaturation, lightening/darkening, mixing, and simulation of color vision deficiencies (deutanomaly, protanomaly, tritanomaly).


Changes in Version 1.3-2

o Fixed error in as_HLS(), which was passing 'ans' rather than 'color' as the colour to convert (and that was producing not only wrong results, but random results because the values in 'ans' were not initialized). Thanks to Thomas Julou for the report.

Changes in Version 1.3-1

o Fixed erroneous use of "return" rather than "return()" in choose_palette()/hclwizard().

Changes in Version 1.3-0

o In addition to the Tcl/Tk-based GUI for choose_palette() there is now a shiny-based GUI. choose_palette() by default still uses the Tcl/Tk version while hclwizard() is a new wrapper that by default calls the new shiny version.

o New function specplot() that converts a given palette in hex codes to RGB and HCL coordinates and visualizes their spectrum as a line plot.

o hex2RGB() now omits the alpha channel (if any) in the hex colors provided.

Changes in Version 1.2-7

o Extended choose_palette() for sequential palettes with multiple hues: Now two palettes are included in the examples that are very close to "viridis" and "magma" from matplotlib in Python (also available in R via package "viridis")

o Changed Depends/Imports/Suggests to conform with current R CMD check.

Changes in Version 1.2-6

o Moved "tcltk" again from Imports to Suggests to facilitate usage of colorspace on platforms where tcltk is not available.

Changes in Version 1.2-5

o Changed Depends/Imports/Suggests to conform with current R CMD check.

Changes in Version 1.2-4

o Bug fix for choose_palette() when using palette functions with optional alpha channels.

Changes in Version 1.2-3

o Alpha channel is preserved in desaturate for named colors (especially "transparent" and NA). (Reported by Simon Potter.)

o Added alpha argument for all palette functions (see ?rainbow_hcl).

o Small fixups for R CMD check.

Changes in Version 1.2-2

o Names of colors are preserved in hex() and hex2RGB() now. (Reported by Richard Cotton.)

Changes in Version 1.2-1

o If a new version of the dichromat package (> 1.2-4) with tritan support is found, this is interfaced in choose_palette().

Changes in Version 1.2-0

o New Tcl/Tk-based GUI for choosing different types of palettes: qualitative (rainbow_hcl), single-hue sequential (sequential_hcl), multi-hue sequential (heat_hcl), and diverging (diverge_hcl). The GUI provides a wide collection of pre-stored palettes, easy manipulation of the corresponding arguments, illustration through a broad range of plot types (maps, heatmaps, variations of bar plots, scatter plots, and many more), emulation of desaturation and dichromatic vision, loading/saving palettes, etc.

o Bug fix in polarLAB_to_LAB conversion.

o All .Call() calls now with PACKAGE = "colorspace".

o Added some simple tests based on the examples and vignette.

Changes in Version 1.1-1

o Added desaturate() function for removal of chroma in a given vector of colors.

o Bug fix in HLS_to_RGB conversion for s == 0.

Changes in Version 1.1-0

o Added "sRGB" colorspace. (Existing "RGB" colorspace is linearized "sRGB".)

o Conversions to and from "HSV" and "HSL" can only occur from or to "RGB" or "sRGB" (because both "HSV" and "HSL" are relative colorspaces, meaning relative to a particular RGB colorspace). (Converting to or from "RGB" gives a different result compared to conversion to or from "sRGB".)

o All 'gamma' parameters in all R-level functions have been deprecated. (The "sRGB" colorspace has implicit gamma.)

Changes in Version 1.0-1

o "Escaping RGBland" paper is now published Computational Statistics & Data Analysis as doi:10.1016/j.csda.2008.11.033. Citation and references updated accordingly.

Changes in Version 1.0-0

o new version to accompany the "Escaping RGBland" paper accepted for publication in Computational Statistics & Data Analysis, see citation("colorspace")

Changes in Version 0.97

o moved color palettes from vcd to colorspace, including vignette("hcl-colors")

o added infrastructure for HLS color space

o new CITATION file

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


1.4-0 by Achim Zeileis, 11 days ago

http://colorspace.R-Forge.R-project.org, http://hclwizard.org/

Report a bug at http://colorspace.R-Forge.R-project.org/contact.html

Browse source code at https://github.com/cran/colorspace

Authors: Ross Ihaka [aut] , Paul Murrell [aut] , Kurt Hornik [aut] , Jason C. Fisher [aut] , Reto Stauffer [aut] , Claus O. Wilke [aut] , Claire D. McWhite [aut] , Achim Zeileis [aut, cre]

Documentation:   PDF Manual  

Task views: Graphic Displays & Dynamic Graphics & Graphic Devices & Visualization

BSD_3_clause + file LICENSE license

Imports graphics, grDevices, stats

Depends on methods

Suggests datasets, utils, KernSmooth, MASS, kernlab, mvtnorm, vcd, tcltk, shiny, shinyjs, ggplot2, dplyr, scales, grid, png, jpeg, knitr, rmarkdown, RColorBrewer, rcartocolor, scico, viridis

Imported by BayesX, DepthProc, DiffusionRgqd, DiffusionRimp, DiffusionRjgqd, Gifi, HH, IsotopeR, JBTools, MapGAM, NMF, NetOrigin, OpenRepGrid, Polychrome, RSurvey, RcmdrMisc, RegularizedSCA, SGP, SubgrPlots, TIMP, Thresher, TreeSearch, Wats, anacor, arulesViz, bea.R, cds, circlize, colorpatch, copula, corr2D, dexter, effects, epicontacts, extracat, forecast, ftsa, gdimap, geiger, genotypeR, ggfan, ggrasp, ggwordcloud, gpairs, heatmaply, hues, lessR, mafs, mapStats, mcmcplots, metafolio, munsell, optimization, pals, pivot, plotKML, qgraph, rainbow, randomcoloR, roloc, rolocISCCNBS, semPlot, seriation, simPop, simsalapar, smacof, smoothAPC, subspace, survsup, swatches, treemap, vcd, visTree, wheatmap.

Depended on by BiplotGUI, MmgraphR, R2BayesX, VIM, ViSiElse, W2CWM2C, bamlss, biclust, frontiles, ips, mixAK, paramGUI, prefmod, snpStatsWriter, spacodiR, tourrGui.

Suggested by DEoptim, LBSPR, LocalControl, OpenStreetMap, PairViz, RGraphics, Radviz, RandomFields, Rcmdr, SWMPr, WRS2, aqp, barsurf, berryFunctions, cba, collapsibleTree, dendextend, dynamichazard, emojifont, flexsurv, gamlss.util, ggplotify, grImport, httk, longCatEDA, mlt.docreg, movMF, netmeta, nodiv, nonrandom, party, psychotree, rasterVis, rattle, recmap, regsem, rpanel, surveillance, tourr, tram, viridis.

Enhanced by Rgnuplot, shades.

See at CRAN