colorspace2.1-2 package

A Toolbox for Manipulating and Assessing Colors and Palettes

adjust_transparency

Adjust or Extract Transparency of Colors

choose_palette

Graphical User Interface for Choosing HCL Color Palettes

color-class

Class "color"

contrast_ratio

W3C Contrast Ratio

coords

Extract the Numerical Coordinates of a Color

cvd_emulator

Graphical User Interface to Check Images for Color Constraints

cvd_image

Convert Colors of an Image

cvd

Color Vision Deficiency (CVD) Conversion Tables

demoplot

Color Palette Demonstration Plot

desaturate

Desaturate Colors by Chroma Removal in HCL Space

divergingx_hcl

(More) Flexible Diverging HCL Palettes

hcl_color_picker

Graphical User Interface to Pick Colors in HCL Space

hcl_palettes

HCL Color Palettes

hclplot

Palette Plot in HCL Space

hex

Convert Colors to Hexadecimal Strings

hex2RGB

Convert Hexadecimal Color Specifications to sRGB Objects

HLS

Create HLS Colors

HSV

Create HSV Colors

LAB

Create LAB Colors

lighten

Algorithmically Lighten or Darken Colors

LUV

Create LUV Colors

max_chroma

Compute Maximum Chroma for Given Hue and Luminance in HCL

mixcolor

Compute the Convex Combination of Two Colors

polarLAB

Create polarLAB Colors

polarLUV

Create polarLUV (HCL) Colors

rainbow_hcl

HCL (and HSV) Color Palettes Corresponding to Base R Palettes

readhex

Read Hexadecimal Color Descriptions

readRGB

Read RGB Color Descriptions

RGB

Create RGB Colors

scale_colour_binned_diverging

HCL-Based Binned Diverging Color Scales for ggplot2

scale_colour_binned_divergingx

HCL-Based Binned Flexible Diverging Scales for ggplot2

scale_colour_binned_qualitative

HCL-Based Binned Qualitative Color Scales for ggplot2

scale_colour_binned_sequential

HCL-Based Binned Sequential Color Scales for ggplot2

scale_colour_continuous_diverging

HCL-Based Continuous Diverging Color Scales for ggplot2

scale_colour_continuous_divergingx

HCL-Based Continuous Flexible Diverging Scales for ggplot2

scale_colour_continuous_qualitative

HCL-Based Continuous Qualitative Color Scales for ggplot2

scale_colour_continuous_sequential

HCL-Based Continuous Sequential Color Scales for ggplot2

scale_colour_discrete_diverging

HCL-Based Discrete Diverging Color Scales for ggplot2

scale_colour_discrete_divergingx

HCL-Based Discrete Flexible Diverging Scales for ggplot2

scale_colour_discrete_qualitative

HCL-Based Discrete Qualitative Color Scales for ggplot2

scale_colour_discrete_sequential

HCL-Based Discrete Sequential Color Scales for ggplot2

simulate_cvd

Simulate Color Vision Deficiency

specplot

Color Spectrum Plot

sRGB

Create sRGB Colors

swatchplot

Palette Swatch Plot

whitepoint

Access or Modify the Whitepoint

writehex

Write Hexadecimal Color Descriptions

XYZ

Create XYZ Colors

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 graphical user interface) 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). Details can be found on the project web page at <https://colorspace.R-Forge.R-project.org/> and in the accompanying scientific paper: Zeileis et al. (2020, Journal of Statistical Software, <doi:10.18637/jss.v096.i01>).

  • Maintainer: Achim Zeileis
  • License: BSD_3_clause + file LICENSE
  • Last published: 2025-09-22