Layer
Layer commands.
Layers commands are applied on currently selected layer. Layer index param is always optional. If not supplied the currently active layer will be targetet. Layer indexes are such that zero is the botton layer.
Command | Value | Description |
---|---|---|
layer-add | Adds a new layer | |
layer-add-color | hex color | Create new layer with some color |
layer-analyze-colors | Analyze layer colors and add them to tatami.state | |
layer-blending-mode | mode | Set blending mode for the selected layer |
layer-brush-texture | Convert layer into brush texture | |
layer-brush-tip | Convert layer into brush tip | |
layer-center | Centers layer to middle of canvas | |
layer-clear | index | Clear layer |
layer-copy | index | Copy layer to clipboard. |
layer-copy-selection | index | Copy layer pixels from currently selected area |
layer-crop-auto | Auto crop and center layer | |
layer-cut | index | Cut layer |
layer-delete | index | Delete layer |
layer-duplicate | Duplicates layer | |
layer-export | index | Exports layers as PNG file |
layer-export-all | Exports all layers as separate PNG files | |
layer-flip-horizontal | Flips layer horizontally | |
layer-flip-vertical | Flips layer vertically | |
layer-hide | index | Hide layer |
layer-import | Import image from device into new layer | |
layer-import-mask | Import image from device and use as mask layer | |
layer-import-url | url | Import image from given URL as new layer |
layer-invert-colors | Invert colors of the layer | |
layer-lock | index | Lock layer |
layer-merge-down | Merge layer with the layer below | |
layer-move | from:to | Move layer from index to other (0 = bottom) |
layer-name | name | Set layer name |
layer-opacity | 0..100 | Set layer opacity |
layer-paste | Paste clipboard content to layer | |
layer-rotate-180 | Rotate layer 180 degrees | |
layer-rotate-90 | Rotate layer 90 degrees clockwise | |
layer-rotate-90-ccw | Rotate layer 90 degrees counter clockwise | |
layer-scale | width:height | Resize layer into given width and height |
layer-scale-to-cover | Resize layer to cover the paper area | |
layer-scale-to-fit | Resize layer to fit inside paper area | |
layer-select | index | Select layer |
layer-show | index | Show layer (vs Hide Layer) |
layer-toggle | index | Toggle layer visibility |
layer-toggle-lock | index | Toggle layer lock |
layer-transform | x:y:w:h | Move and scale layer (width and height optional) |
layer-unlock | index | Unlock layer (vs Lock Layer) |
Blending Mode
These are the possible mode string values for layer-blending-mode
command
- normal
- screen
- add
- overlay
- darken
- lighten
- difference
- negate
- multiply
- exclude
- hardlight
- softlight
- pinlight
- layerMask
Example
// Creates bright red layer
cmd("layer-add-color:#ff0000")
// Create new layer (always gets the topmost)
cmd("layer-add")
// Lock bottom layer
cmd("layer-lock:0")
// Give layer a name
cmd("layer-name:Draw here")