DocumentationDocumentation
Darty.ai
Get Started
Basics
Methods
Colors
UI
Workflows
Darty.ai
Get Started
Basics
Methods
Colors
UI
Workflows
  • Get Started

    • Installation and Login
    • Your First Darty Document
    • Installers - Instructions and Downloads
    • Licensing
  • Basics

    • Darty Basics
    • Darty Header
    • Darty Tags
  • Methods

    • Darty Methods
    • Align
    • Appearance - General
    • Appearance - Colors & Swatches
    • Appearance - Effect Properties
    • Artboard Methods
    • Arrange
    • Attributes
    • Clean Document
    • Clipping Mask Make and Release
    • Color Mode
    • Compound Path - Make and Release
    • Distribute
    • Duplicate
    • Expand
    • Fit To Bounds
    • Group & Ungroup
    • Layer Methods
    • Outline
    • Pathfinder
    • Place
    • Rasterize
    • Reduce To Basic Appearance
    • Remove
    • Swatch Methods
    • Tags Methods
    • Text
    • Transform Methods
    • zOrder
    • Skip and *
  • Colors

    • Color Libraries
  • User Interface

    • Darty User-Interface
    • Tags Tab
    • Data Tab
    • Export Tab
    • Settings Tab
    • Help Tab
    • Export Settings
    • Export Validation
    • Job Export Settings
    • Export Counter Variables
    • Export Progress
    • Export Presets
    • Recent Files
    • Color Dialog
  • Cloud Data

    • Darty-Ai Cloud Data Integrations
    • Darty-Ai with Google Sheets
  • Workflows

    • Darty Workflows
    • Darty Preview
    • Darty Export Workflows
    • Darty Data Workflows

Layer Methods

Layer

The Layer method can be used to add, duplicate, edit, and remove layers.
The action performed is set by the mode property value, which can be add, addEdit, duplicate, edit, or remove.
For convenience, you can use the addLayer, addEditLayer, duplicateLayer, editLayer, and removeLayer methods which automatically set the mode.
The default layer mode is addEdit this mode will edit a layer if it exists and if it does not exist it will add the layer.
Besides the properties available in Layer Options, the layer can be moved relative to other layers, or tagged artwork.

Layer Options

Layer Options

Layer Options

Use the name or number properties to target which layer to edit, duplicate or remove.
Set the layer's options using the name, newName, template, locked, visible, print, preview, dim and dimPercent properties.
When adding a new layer you can use the name property to set its name. When editing or duplicating a layer, use newName to set the new name.
See layer color for details on setting the layers color.

Location

Layers are by default added and duplicated above existing layers or, if provided above a targetLayer or targetTagSearch.
You can set the layer's exact location, by providing a targetLayerName, targetLayerNumber and / or a targetTagSearch.
Set the location property's value to aboveAll or belowAll to place the layer at the top or bottom of the document.
Set the location property's value to top and bottom to place the layer at the top or bottom of a layer or group.
Set the location property's value to above and below to place the layer above or below a tagged target artwork or a layer.
The default value of location is above.

Layer Color

Use the color property to set the color of the layer, i.e. the color that shows next to the layer on the layer panel and the paths of the panel's artwork.
Hex, decimal values and named values can be provided to set the layer.
#ff0000, ff0000, f00 (6 or 3 digit hex values), 255, 0, 0, (rgb values), 0 100 100 0 (cmyk) 50 127 50 lab lab, red (CSS named color or custom color name) all would set the layer color to red.
Named colors can be enabled and disabled in the settings tab. Named colors with spaces like, light blue should be either quoted "light blue" or written as lightBlue (Not case sensitive), light-blue or light_blue.

Removing Layers

To remove a layer, use the remove mode or the removeLayer method.
Set the number or name of the layer to be removed. The layer's sublayers and artwork will be deleted.

Layer Properties

PropertyModes used withDescription
color 
addEdit add duplicate editThe layer color as shown in the layers panel and the layers artwork paths.
Sample Values:
#ff0000, ff0000, f00 (6 or 3 digit hex values), 255, 0, 0, (rgb values), 0 100 100 0 (cmyk) 50 127 50 lab lab, red (CSS named color or custom color name)
dimPercent 
addEdit add duplicate editThe percentage that images should be dimmed, if set to -1 the images will not be dimmed.
Valid Values: -1 10, 50, 70
location 
addEdit add duplicate editThe location where the layer should be relative to the target.
Sample Values:
aboveAll or belowAll to place the layer at the top or bottom of the document
top and bottom place the layer at the top or bottom of a layer or group.
above and below to place the layer at the above or below artwork or a layer.
locked 
addEdit add duplicate editWhether or not the layer is locked.
Valid Values: true or false
mode 
addEdit add duplicate edit removeWhen using the layer method, the mode, which sets the process to be done to the layers, must be set.
When using addLayer, addEditLayer, duplicateLayer, editLayer, or removeLayer methods, the mode is set automatically.
Valid Values: add addEdit [Default] duplicate edit remove
name / layerName 
addEdit add duplicate edit removeThe case sensitive name of the layer to be processed. Use either name or number and not both.
Sample Values: Layer 1, Images
newName 
addEdit add duplicate editThe new name the layer should be called.
Valid Values: true or false
number / layerNumber 
addEdit add duplicate edit removeThe index of the layer to be processed. Use either layerName or layerNumber and not both.
Sample Values: 1, 4
preview 
addEdit add duplicate editWhether or not the layer should preview.
Valid Values: true or false
print 
addEdit add duplicate editWhether or not the layer should print.
Valid Values: true or false
targetLayerName / parent 
addEdit add duplicate editThe name of the target layer, relative to which the location of the new or edited layer is given.
Sample Values: Layer 1, Images
targetLayerNumber 
addEdit add duplicate editThe number of the target layer, relative to which the location of the new or edited layer is given.
Sample Values: 1, 4
targetTagSearch 
addEdit add duplicate editThe tagSearch relative to which the location of the new or edited layer is given. If a target layer is also provided, then the artwork matching the tagSearch in the given layer will be used.
Sample Values: Layer 1, Images
template 
addEdit add duplicate editWhether or not the layer is a template.
Valid Values: true or false
visible 
addEdit add duplicate editWhether or not the layer is visible.
Valid Values: true or false
* 
addEdit add duplicate edit removeSet to false if you want the method to be skipped in a particular row.
Valid Values: true or false
skip 
addEdit add duplicate edit removeSet to true is you want the method to be skipped in a particular row.
See * and Skip for details.
Valid Values: true or false

Example Spreadsheet and Screenshots

Spreadsheet using layer and mode

*
layer
modenamenewNamecolortargetLayertargetlocationvisiblelockedprintpreviewtemplatedimPercentage
add
addGoldgoldOrange LayeraboveTRUE
duplicateGreen LayerLocked and Hidden#bcaBlue LayerbluebelowFALSETRUE
editOrange LayerGrassGreenGreen LayerbottomFALSE
editGreen LayerGray Layergrayscale 20TRUEFALSE25
editBlue Layer0 0 255aboveAll
removeBlue Layer

Row 0

Original Artwork

Panel For Row 0

Original Artwork

Row 1

Row 1 Artwork

A layer is added above existing layers, it is named as per its layer number

Panel For Row 1

Row 1 Panel

mode: add

Row 2

Row 2 Artwork

The layer "Gold" is added above "Orange Layer", it is colored gold, it is made a "template" layer

Panel For Row 2

Row 2 Panel

mode: add name: Gold color: gold targetLayer: Orange Layer location: above template: true

Row 3

Row 3 Artwork

The layer "Green Layer" is duplicated above the artwork tagged "blue" which is in the "Blue Layer", the layer is named "Locked and Hidden" and colored #bca, it's artwork is not visible and the layer is locked

Panel For Row 3

Row 3 Panel

mode: duplicate name: Green Layer newName: Locked and Hidden color: #bca targetLayer: Blue Layer target: blue location: above visible: false locked: true

Row 2

Row 2 Artwork

The layer "Gold" is added above "Orange Layer", it is colored gold, it is made a "template" layer

Panel For Row 2

Row 2 Panel

mode: add name: Gold color: gold targetLayer: Orange Layer location: above template: true

Row 3

Row 3 Artwork

The layer "Green Layer" is duplicated above the artwork tagged "blue" which is in the "Blue Layer", the layer is named "Locked and Hidden" and colored #bca, it's artwork is not visible and the layer is locked

Panel For Row 3

Row 3 Panel

mode: duplicate name: Green Layer newName: Locked and Hidden color: #bca targetLayer: Blue Layer target: blue location: above visible: false locked: true

Row 4

Row 4 Artwork

"Orange Layer" is moved to the bottom of the "Blue Layer", colored "Grass Green", it's artwork is not previewed, i.e. only the artworks outlines will be visible

Panel For Row 4

Row 4 Panel

mode: edit name: Orange Layer color: GrassGreen targetLayer: Green Layer location: bottom preview: false

Row 5

Row 5 Artwork

"Green Layer" is renamed to "Gray Layer" colored gray 20, the layer is locked, will not print and images are dimmed to 25%

Panel For Row 5

Row 5 Panel

mode: edit name: Green Layer newName: Gray Layer color: grayscale 20 locked: true print: false dimPercentage: 25

Row 6

Row 6 Artwork

"Blue Layer" colored RGB 0 0 255 and moved above all other layers

Panel For Row 6

Row 6 Panel

mode: edit name: Blue Layer color: 0 0 255 location: aboveAll

Row 7

Row 7 Artwork

"Blue Layer" and its artwork is removed (deleted)

Panel For Row 7

Row 7 Panel

mode: remove name: Blue Layer

Spreadsheet using addLayer

*
addLayer
namecolortargetLayerlocationtemplate
GoldgoldOrange LayeraboveTRUE

Spreadsheet using addEditLayer

*
CommentaddEditLayer
*namecolorlockedvisible
Edits the "Red" layer if it exists, otherwise adds the new layerRedredFALSETRUE
Edits the "Layer 2" layer if it exists, otherwise adds the new layerLayer 2#f80FALSEFALSE
Edits the "Gold" layer if it exists, otherwise adds the new layerGoldgoldTRUETRUE

Spreadsheet using duplicateLayer

*
duplicateLayer
namenewNamecolortargetLayertargetlocationvisiblelocked
Green LayerLocked and Hidden#bcaBlue LayerbluebelowFALSETRUE

Spreadsheet using editLayer

*
editLayer
namenewNamecolortargetLayerlocationlockedprintpreviewdimPercentage
Orange LayerGrassGreenGreen LayerbottomFALSE
Green LayerGray Layergrayscale 20TRUEFALSE25
Blue Layer0 0 255aboveAll

Spreadsheet using removeLayer

*
removeLayer
nameLayerNumber
Blue Layer
1
visible 
visible
Last Updated: 3/18/26, 2:06 AM
Contributors: Trevor
Prev
Group & Ungroup
Next
Outline