powered by
This creates a character vector that represents colours so when it is printed, colours will be formatted as hexadecimal strings.
pal_colour(x = character())is_colour(x)as_colour(x)# S3 method for default as_colour(x)# S3 method for palettes_palette as_colour(x)
is_colour(x)
as_colour(x)
# S3 method for default as_colour(x)
# S3 method for palettes_palette as_colour(x)
An S3 vector of class palettes_colour.
palettes_colour
For pal_colour(): A character vector of any of the three kinds of R colour specifications.
pal_colour()
For as_colour(): An object to be coerced.
as_colour()
For is_colour(): An object to test.
is_colour()
Colours can be specified using either:
Hexadecimal strings of the form "#RRGGBB" or "#RRGGBBAA"
"#RRGGBB"
"#RRGGBBAA"
Colour names from grDevices::colors()
grDevices::colors()
Positive integers i that index into grDevices::palette()[i]
i
grDevices::palette()
[i]
pal_palette()
pal_colour(c("darkred", "#0F7BA2")) is_colour("darkred") is_colour(pal_colour("darkred")) as_colour("#0F7BA2")
Run the code above in your browser using DataLab