Learn R Programming

RImagePalette (version 0.1.1)

display_palette: Display color palette

Description

Displays the created palette as a barchart with axis labels representing hex values of the colors. A more attractive method for doing so would be to use show_cols() from library(scales).

Usage

display_palette(palette)

Arguments

palette
Vector The output of image_palette.

Value

A plot of the colors extracted from the image

See Also

scales::show_cols()

Examples

Run this code
img <- jpeg::readJPEG(system.file("img", "Rlogo.jpg", package="jpeg"))
display_palette(image_palette(img, n=5))

Run the code above in your browser using DataLab