col2hex(x)
rgb2hex(v)
paletteindex(x)
samecolour(x,y)
col2rgb
.col2hex
and rgb2hex
, a character vector containing
hexadecimal colour codes. For paletteindex
, an integer vector, possibly containing
NA
values.
For samecolour
, a logical value or logical vector.
paletteindex("green")
returns NA
because
the green colour in the default palette is called "green3"
.col2hex
converts colours specified in any format
into their hexadecimal character codes. rgb2hex
converts RGB colour values into their hexadecimal
character codes.
paletteindex
checks whether the colour or colours specified
by x
are available in the default palette returned by
palette()
. If so, it returns the index or indices of
the colours in the palette. If not, it returns NA
.
samecolour
decides whether two colours x
and y
are equivalent.
col2rgb
,
palette
See also the class of colour map objects:
colourmap
,
interp.colourmap
,
tweak.colourmap
.
samecolour("grey", "gray")
paletteindex("grey")
Run the code above in your browser using DataLab