Learn R Programming

schemr (version 0.3.1)

rgb_to_hsl: Convert RGB space into HSL space

Description

Convert RGB space into HSL space

Usage

rgb_to_hsl(rgb)

Value

a tibble of H, S and L colour channels.

Arguments

rgb

A dataframe or matrix with red, green and blue colour channels located in the columns 1 to 3, respectively. Colour channel values should be between 0 and 255, inclusive.

Examples

Run this code
red <- sample(x = 1:255, size = 10, replace = TRUE)
green <- sample(x = 1:255, size = 10, replace = TRUE)
blue <- sample(x = 1:255, size = 10, replace = TRUE)
rgb_to_hsl(data.frame(r = red, g = green, b = blue))

Run the code above in your browser using DataLab