create_texture: Create Texture

View source: R/create_texture.R

create_textureR Documentation

Create Texture

Description

Creates a texture map based on 5 user-supplied colors.

Usage

create_texture(
  lightcolor,
  shadowcolor,
  leftcolor,
  rightcolor,
  centercolor,
  cornercolors = NULL
)

Arguments

lightcolor

The main highlight color. Corresponds to the top center of the texture map.

shadowcolor

The main shadow color. Corresponds to the bottom center of the texture map. This color represents slopes directed directly opposite to the main highlight color.

leftcolor

The left fill color. Corresponds to the left center of the texture map. This color represents slopes directed 90 degrees to the left of the main highlight color.

rightcolor

The right fill color. Corresponds to the right center of the texture map. This color represents slopes directed 90 degrees to the right of the main highlight color.

centercolor

The center color. Corresponds to the center of the texture map. This color represents flat areas.

cornercolors

Default ‘NULL'. The colors at the corners, in this order: NW, NE, SW, SE. If this vector isn’t present (or all corners are specified), the mid-points will just be interpolated from the main colors.

Examples

#Here is the `imhof1` palette:
create_texture("#fff673","#55967a","#8fb28a","#55967a","#cfe0a9") %>%
 plot_map()

#Here is the `unicorn` palette:
create_texture("red","green","blue","yellow","white") %>%
 plot_map()

tylermorganwall/rayshader documentation built on Dec. 21, 2024, 4:29 p.m.