photoshop_fill_layer
Fills the active Photoshop layer or current selection with a solid RGB color, leaving the selection intact.
Instructions
Fill the active layer with a solid RGB color. If a selection exists, only that region is filled and the selection stays; otherwise the whole layer is filled and the selection is cleared.
Use when: a flat color fill on the active layer or on the current selection. Do NOT use when: a new empty layer is needed first — use photoshop_create_layer, then this. Do NOT use when: the fill should be a two-color gradient — use photoshop_fill_gradient. Do NOT use when: the selection should be filled with surrounding content — use photoshop_content_aware_fill. Do NOT use when: the active layer is text — rasterize with photoshop_rasterize_layer first, or recolor type with photoshop_set_text_color. A smart object is rasterized in place and then filled. No extra layer is created.
Returns: the RGB color applied. Preconditions: active document and an unlocked non-text layer. Side effects: overwrites those pixels. The same color on the same pixels is idempotent. Reversible with photoshop_undo.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| red | Yes | Red component (0-255) | |
| blue | Yes | Blue component (0-255) | |
| green | Yes | Green component (0-255) | |
| document_id | Yes | Photoshop document id from photoshop_get_state / photoshop_list_documents. Send null or 0 to use the active document. A positive number activates that document before the tool runs. When no document is open, a stale id does not block the call. |