Anatomy of a plugin

Everything a plugin can declare. All of it is optional except the id and the name.

What it can declare

KeyAdds
id, nameRequired. The id is the plugin's own short name (letters, digits, - . _), unlike any other plugin's.
about, authorShown in the list of plugins.
versionThe plugin's version, such as 1.2.0. A later one that is released is offered as an update.
icon, colorThe plugin's sign and the color it is shown on, in the list of plugins and in the catalog.
toolsTools in the toolbox.
elementsThings to insert that the plugin draws itself, with adjustable settings.
propertiesA group of settings in a layer's properties.
effects, filtersLive effects in the effects window; one-off filters in the Filter menu.
backdropsBackground effects a theme can use.
overlaysDrawing over the picture on the canvas.
docksA whole view of the plugin's own, opened from the toolbox.
animationsSomething drawn as the loop runs, played and exported as an animation.
exportsKinds of file in the export window.
inserts, commandsItems in the Insert menu; commands in a Plugins menu.
templates, palettes, sizesTemplates to start from; color palettes; image sizes.
settings, usesSettings of the plugin's own; whether a project needs the plugin.

Things a plugin adds are known inside the program as pluginId:key. A tool with the key spray in the plugin example is example:spray.

Fields

Wherever a plugin has settings (a tool's, an element's, a filter's, a window's, its own), they are a list of fields.

fields: [
  { key: 'amount', label: 'Amount', low: 0, high: 100, step: 1, usual: 50 },      // a slider with a number
  { key: 'tint', label: 'Color', usual: '#F7C56B', color: true },                 // a color
  { key: 'size', label: 'Size', usual: 'Medium', choices: ['Small', 'Medium', 'Large'] },      // one of several
  { key: 'outline', label: 'Outline only', usual: false, toggle: true },          // on or off
  { key: 'title', label: 'Title', usual: '', text: true },                        // a line of text
],
from rassam import slider, color, choice, toggle, text

fields = [
    slider('amount', 'Amount', 0, 100, 50, step=1),               # a slider with a number
    color('tint', 'Color', '#F7C56B'),                            # a color
    choice('size', 'Size', ['Small', 'Medium', 'Large'], 'Medium'),      # one of several
    toggle('outline', 'Outline only', False),                     # on or off
    text('title', 'Title', ''),                                   # a line of text
]

usual is the value a field starts with. A number may have a unit, a few letters shown after it. What is set arrives as settings, keyed by each field's key (in Python, also as attributes: settings.amount).

Icons

Where an icon is asked for, it is the name of one of the program's own signs, among them: Brush, Pencil, Eraser, Fill, Wand, Gradient, Line, Rectangle, Ellipse, Polygon, Text, Layer, Media, Canvas, Slot, star, plug, gear, points, play, open, user. An unknown name shows the plug.