Learn R Programming

bittermelon (version 2.2.1)

col2int: Color to (native) integer conversions

Description

col2int() converts color strings to (native) color integers. int2col() converts (native) color integers to color strings.

Usage

col2int(x)

int2col(x)

Value

col2int() returns an integer. int2col() returns a (hex) color string.

Arguments

x

Color value to convert.

Details

  • Colors are also standardized by col2hex().

  • Requires either the colorfast or the farver package.

Examples

Run this code
if (requireNamespace("farver", quietly = TRUE)) {
  int2col(col2int("red"))
}

Run the code above in your browser using DataLab