add_color: Add a named color to an ASE swatch object

View source: R/ase-write.R

add_colorR Documentation

Add a named color to an ASE swatch object

Description

Add a named color to an ASE swatch object

Usage

add_color(ase_obj, name, model, color_vals, type)

Arguments

ase_obj

An ASE object created with create_ase()

name

name of the color

model

one of "RGB", "Gray", "CMYK", or "LAB"

color_vals

vector of color values associated with the chosen model

type

one of "global", "spot", or "process"

Value

ase_obj (invisibly)

Examples

create_ase() |>
add_color(
  name = "RGB Red",
  model = "RGB",
  color_vals = as.vector(col2rgb("#FF0000")/255),
  type = "global"
) |>
  add_color(
    name = "RGB Yellow",
    model = "RGB",
    color_vals = as.vector(col2rgb("#FFFF00")/255),
    type = "global"
  ) |>
  ase_encode() |>
  writeBin(tempfile(fileext = ".ase"))

hrbrmstr/swatches documentation built on April 8, 2022, 3:59 p.m.