Learn R Programming

ColorNameR (version 0.1.0)

name: Name a color given its coordinates in a specified color space.

Description

Name a color given its coordinates in a specified color space.

Usage

name(color, colorspace = "Lab", illuminant = NULL, language = "english")

Arguments

color

A matrix whose rows specify colors.

colorspace

The color space the coordinates of the colors are in.

illuminant

The reference white, or NULL if not needed.

language

The language of the color name, between English, French, German, and Spanish.

Value

The name of the color, according to the UPOV.

Details

The available color spaces are "XYZ", "sRGB", "Apple RGB", "CIE RGB", "Luv", and "Lab" (default). If the color space is an RGB variant, the coordinates must take values between 0 and 1.

Examples

Run this code
# NOT RUN {
name(c(65, 20, -20))
name(c(65, 20, -20), language="Spanish")
name(c(65, 20, -20), language="es")
name(c(244/255, 234/255, 184/255), colorspace="sRGB")
name(rbind(c(65, 20, -20), c(69, 4, -31)))
# }

Run the code above in your browser using DataLab