# editor.compose.set

Source: https://docs.lightair.app/developers/remote-api/editor.compose.set

> Sets a picture clip's blend mode, or its chroma or luma key and the key's settings.

JSON-RPC 2.0 method of Lightair's Remote API (ws://localhost:4455/rpc). Group: Editor. Script plugins need the `project.write` permission.

A chroma key takes `color`, `similarity`, `smoothness` and `spill`; a luma key `low`, `high` and `softness`; each 0 to 1. A setting of the other kind of key is refused.

## Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `clip` | `string` | yes | The clip's id, from editor.timeline.get. |
| `blend` | `string` | no | A blend mode's name. |
| `key` | `string` | no | `none`, `chroma` or `luma`. |
| `color` | `string` | no | A chroma key's colour, "#RRGGBB". |
| `similarity` | `number` | no | 0 to 1. |
| `smoothness` | `number` | no | 0 to 1. |
| `spill` | `number` | no | 0 to 1. |
| `low` | `number` | no | 0 to 1. |
| `high` | `number` | no | 0 to 1. |
| `softness` | `number` | no | 0 to 1. |
| `canvas` | `string` | no | A canvas's id or name, shown first. Default: the canvas shown. |

## Result

| Name | Type | Required | Description |
|---|---|---|---|
| `blend` | `string` | no | Its blend mode. |
| `key` | `object | null` | no | Its key and settings. |

## Errors

Invalid params (-32602) with nothing to set, for an unknown blend or key, a value out of range, or a sound clip. A state error (-32005) for a key setting when the clip has no key. A state error (-32005) when no Editor project is open, or the open one is read-only because a newer Lightair made it. Invalid params (-32602) for a clip id that can't be read; not found (-32004) for a clip that isn't on the canvas.

## Events

- `editor.changed`

## From an AI agent

The MCP server's `editor_compose (action: set)` reaches this method.

## Example

```json
{ "jsonrpc": "2.0", "id": 1, "method": "editor.compose.set", "params": { "clip": "019ad3f6-5e6f-7071-8283-9e0f1a2b3c4d", "key": "chroma", "similarity": 0.4 } }
```

Result:

```json
{ "blend": "Normal", "key": { "key": "chroma", "color": "#00FF00", "similarity": 0.4, "smoothness": 0.032, "spill": 0.04 } }
```

## Related

- [editor.compose.mask.add](https://docs.lightair.app/developers/remote-api/editor.compose.mask.add.md)
