Expand description
R color system — 657 named colors, hex parsing, color builtins.
The named color table matches R’s colors() output exactly, including all
X11/CSS colors and the gray0–gray100 / grey0–grey100 series. Lookup is
case-insensitive via binary search on lowercase names.
Structs§
- RColor
- An RGBA color value. Alpha defaults to 255 (fully opaque).
Constants§
- DEFAULT_
PALETTE - R’s default palette: c(“black”,“red”,“green3”,“blue”,“cyan”,“magenta”,“yellow”,“gray”)
- NAMED_
COLORS - All 657 R named colors, sorted alphabetically for binary search.
Generated from R’s
colors()output andcol2rgb()values.
Statics§
- __
BUILTIN_ 🔒REG_ BUILTIN_ COLORS - __
BUILTIN_ 🔒REG_ BUILTIN_ RGB - __
INTERP_ 🔒REG_ INTERP_ COL2RGB - __
INTERP_ 🔒REG_ INTERP_ PALETTE
Functions§
- builtin_
colors 🔒 - Return a character vector of all 657 named color names.
- builtin_
rgb 🔒 - Create hex color strings from RGB(A) values.
- clamp_
to_ 🔒u8 - Clamp a floating-point value to 0–255 and round to nearest u8.
- default_
palette - Returns the default palette as a
Vec<RColor>. - get_
double_ 🔒vec - Extract a vector of f64 from an RValue, for use in rgb().
- interp_
col2rgb 🔒 - Convert color specifications to RGB values.
- interp_
palette 🔒 - Get or set the color palette.