pal_luv_bezier: Create LUV palette-function using Bézier spline

View source: R/pal_luv_bezier.R

pal_luv_bezierR Documentation

Create LUV palette-function using Bézier spline

Description

This takes a matrix of LUV control-points and returns a palette-function (that returns LUV values) based on a Bézier spline using those control-points.

Usage

pal_luv_bezier(mat_luv, rescale_path = TRUE, n = 21)

Arguments

mat_luv

matrix of LUV coordinates, control-points for Bézier spline.

rescale_path

logical indicating to rescale the palette function to be perceptually-uniform with respect to the input.

n

numeric if rescale_path, number of equally-spaced Bézier points to calculate.

Details

The default is to rescale the palette function so that it is perceptually uniform (in LUV space) using 21 points from the spline.

Value

A function with S3 class cpath_palette.

Examples

 # create palette-function
 pb <- pal_luv_bezier(mat_luv_blues)

 # evaluate
 pb(c(0, 0.5, 1))


ijlyttle/colorpath documentation built on Sept. 13, 2022, 7:44 p.m.