Data viz
R Language Colors
Base R and ggplot2 accept HEX strings, rgb(), and hcl() for statistical graphics. Use alpha in rgb() for transparency. Spec reference: Documentation.
Starter template
# Base R
plot(x, y, col = "#7C3AED")
# ggplot2
ggplot(df, aes(x, y)) +
geom_point(color = "#7C3AED")Color samples
FAQ
rgb() maxColorValue?
Base R rgb() needs maxColorValue=255 when you pass 0–255 integers. ggplot2 accepts HEX strings directly in scales.
hcl() vs hex for accessibility?
hcl() gives perceptually even steps for heatmaps. For categorical brand colors, prefer fixed HEX from your style guide.
Can I copy the syntax chips?
Yes — click the secondary chip to copy platform syntax. HEX and RGB chips copy sRGB values for mockups, design handoff, and ChromaXP tools.
Are RGB and CMYK print-ready?
RGB and CMYK here are computed from HEX for quick reference. For ink and paper, re-check against your print profile or Pantone bridge.