@pixerate/editor 0.222.0 → 0.222.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/skills/README.md +7 -3
- package/skills/pixerate-vector/SKILL.md +11 -61
- package/skills/pixerate-vector/references/best-practices.md +62 -0
- package/skills/pixerate-vector-icon-set/SKILL.md +111 -0
- package/skills/pixerate-vector-icon-set/evals/consistent-strokes.json +22 -0
- package/skills/pixerate-vector-icon-set/evals/plus-icon.json +15 -0
- package/skills/pixerate-vector-icon-set/evals/repeats-as-symbol.json +192 -0
- package/skills/pixerate-vector-illustration/SKILL.md +112 -0
- package/skills/pixerate-vector-illustration/evals/clip-stripes.json +21 -0
- package/skills/pixerate-vector-illustration/evals/radial-sun.json +16 -0
- package/skills/pixerate-vector-illustration/evals/subtle-shadow.json +16 -0
- package/skills/pixerate-vector-logo/SKILL.md +107 -0
- package/skills/pixerate-vector-logo/evals/centre-lockup.json +20 -0
- package/skills/pixerate-vector-logo/evals/knockout-ring.json +21 -0
- package/skills/pixerate-vector-logo/evals/live-union.json +19 -0
package/package.json
CHANGED
package/skills/README.md
CHANGED
|
@@ -44,6 +44,9 @@ request like "clean up this export" finds it.
|
|
|
44
44
|
| [`pixerate-image-portrait-retouch`](pixerate-image-portrait-retouch/SKILL.md) | Image (`pixerate-image-editor`) | Blemishes, stray hairs and flaws healed on their own layer, dodge and burn, eyes and teeth, kept natural. |
|
|
45
45
|
| [`pixerate-image-product-photo`](pixerate-image-product-photo/SKILL.md) | Image (`pixerate-image-editor`) | Product cutouts on pure white or a brand colour, a grounding shadow, accurate colour, centred marketplace crops. |
|
|
46
46
|
| [`pixerate-spreadsheet-clean-import`](pixerate-spreadsheet-clean-import/SKILL.md) | Spreadsheet (`pixerate-spreadsheet`) | Imported or pasted data made tidy: structure, headers, types (currency, comma decimals, day-first dates, leading zeros, missing values), text, duplicates and validation. |
|
|
47
|
+
| [`pixerate-vector-icon-set`](pixerate-vector-icon-set/SKILL.md) | Vector (`pixerate-vector`) | Icons on one grid with padding, one stroke, cap, join and radius, crisp coordinates, clean paths, symbols and SVG export. |
|
|
48
|
+
| [`pixerate-vector-logo`](pixerate-vector-logo/SKILL.md) | Vector (`pixerate-vector`) | Marks from primitives with live booleans, optical corrections, an aligned lockup, colour variants as symbols, outlined delivery files. |
|
|
49
|
+
| [`pixerate-vector-illustration`](pixerate-vector-illustration/SKILL.md) | Vector (`pixerate-vector`) | Block in back to front, gradients and stacked fills for form, masks, blends, subtle shadows with one light, export. |
|
|
47
50
|
| [`pixerate-talking-head-edit`](pixerate-talking-head-edit/SKILL.md) | Video (`pixerate-video-editor`) | Talking-head cleanup by transcript: fillers, long pauses and stutters found in one pass and cut as one plan reviewed before it applies. Owns the dialogue tools. |
|
|
48
51
|
| [`pixerate-bgm-alignment`](pixerate-bgm-alignment/SKILL.md) | Video (`pixerate-video-editor`) | Background music: beats and cuts on the beat, ducking under speech, loudness in LUFS. Owns the music tools. |
|
|
49
52
|
|
|
@@ -105,9 +108,10 @@ same change.
|
|
|
105
108
|
it ships evals. Add its row to the workflow table above.
|
|
106
109
|
- **Evals.** Each workflow skill ships at least three scenarios in `evals/*.json`, run by
|
|
107
110
|
`packages/core/tests/agent-skill-evals.test.ts`. An eval has a `prompt` (the task, in the
|
|
108
|
-
user's words), a `fixture` (the starting document: `{ "editor": "spreadsheet", "rows" }
|
|
109
|
-
`{ "editor": "image", "width", "height", "background", "shapes" }`
|
|
110
|
-
|
|
111
|
+
user's words), a `fixture` (the starting document: `{ "editor": "spreadsheet", "rows" }`,
|
|
112
|
+
`{ "editor": "image", "width", "height", "background", "shapes" }` or `{ "editor":
|
|
113
|
+
"vector", "width", "height", "setup" }` with commands that draw the starting art), `checks` (a read-only
|
|
114
|
+
tool, or `run_command` with a read-only command such as `vector.list`, its `args`, what its result must match in `expect`, and `why`) and a `solution` (the
|
|
111
115
|
tool calls an expert would make). The test proves each eval: some check fails on the fixture,
|
|
112
116
|
and all pass after the solution. A model harness runs the same file with the model in place
|
|
113
117
|
of the solution. In `expect`, objects match key by key and arrays element by element, with
|
|
@@ -54,6 +54,15 @@ carry a live effect stack. Every command is a `vector.*` command run with `run_c
|
|
|
54
54
|
Parameter details (gradient fields, effect parameters, width profiles, envelopes) are in
|
|
55
55
|
[references/commands.md](references/commands.md).
|
|
56
56
|
|
|
57
|
+
## Workflow skills
|
|
58
|
+
|
|
59
|
+
For these jobs, load the workflow skill too: it has the method, the checks between steps and
|
|
60
|
+
the pitfalls, and uses the commands below.
|
|
61
|
+
|
|
62
|
+
- `pixerate-vector-icon-set`: icons on one grid, one stroke and style, crisp, as symbols and SVG.
|
|
63
|
+
- `pixerate-vector-logo`: marks from booleans, a lockup, colour variants, outlined delivery files.
|
|
64
|
+
- `pixerate-vector-illustration`: block in, gradients and stacked fills, masks, blends, shadows.
|
|
65
|
+
|
|
57
66
|
## Working method
|
|
58
67
|
|
|
59
68
|
1. **Read.** `vector.list` gives the artboard size, every node depth first (id, type, name,
|
|
@@ -74,30 +83,16 @@ Parameter details (gradient fields, effect parameters, width profiles, envelopes
|
|
|
74
83
|
|
|
75
84
|
## Best practices
|
|
76
85
|
|
|
77
|
-
- **Diagrams with connectors.** Lay the boxes out first, then `vector.connect` them (in one
|
|
78
|
-
`run_commands` batch) rather than drawing lines: connectors stay attached when boxes move, and
|
|
79
|
-
`route: "elbow"` with a small `radius` reads well in flowcharts. Leave sides `auto` unless a
|
|
80
|
-
connector must leave a particular side.
|
|
81
|
-
|
|
82
86
|
- **Frames for anything that resizes.** Build screens, cards, buttons and banners inside a frame
|
|
83
87
|
(`vector.addFrame` or `vector.frameSelection`), set each child's constraints with
|
|
84
88
|
`vector.setResizing` (backgrounds and dividers `leftRight`, icons pinned to their corner, titles
|
|
85
89
|
`center`), then resize with `vector.setFrame` to produce other sizes from one design. Export each
|
|
86
90
|
artboard with `vector.exportFrameSvg`.
|
|
87
|
-
|
|
88
|
-
- **Constraints for precise, editable geometry.** For technical drawings, diagrams, floor plans or
|
|
89
|
-
any shape that must keep exact relations, draw it roughly, run `vector.autoConstrain`, then add
|
|
90
|
-
the dimensions that matter (`vector.addConstraint` distance / angle / radius) and name them so
|
|
91
|
-
related sizes follow one another (`vector.setConstraintValue` with expressions like `w / 2`).
|
|
92
|
-
Check `vector.listConstraints` `dof`: aim for `fully` on parts that must not drift; `over`
|
|
93
|
-
means some constraints repeat others. Prefer few, meaningful constraints over many.
|
|
94
|
-
|
|
95
91
|
- **Symbols for repeats.** When the same art appears several times (icons in a set, trees in a
|
|
96
92
|
scene, bullets, a logo mark), make it once and place instances (`vector.makeSymbol`, then
|
|
97
93
|
`vector.placeSymbol` with `x` / `y` or a `transform`), so one edit in isolation changes them all.
|
|
98
94
|
Give each a clear name. Use `vector.setInstanceOptions` `fill` / `stroke` for colour variants and
|
|
99
95
|
`hidden` to drop a part, rather than detaching; detach only when one copy must diverge for good.
|
|
100
|
-
|
|
101
96
|
- **Text.** Use point text for labels and headlines, area text (`width`, `height`) for anything
|
|
102
97
|
that should wrap, text on a path for badges and seals. Check `overflow` in the summary every
|
|
103
98
|
text write returns: hidden lines or characters mean the box or path is too small. Keep one or
|
|
@@ -106,56 +101,11 @@ Parameter details (gradient fields, effect parameters, width profiles, envelopes
|
|
|
106
101
|
than splitting text into separate nodes, so it still edits as one paragraph. Create Outlines
|
|
107
102
|
only for final artwork or logos that must not depend on fonts; keep a copy as text if it may
|
|
108
103
|
change.
|
|
109
|
-
|
|
110
|
-
text
|
|
111
|
-
turns sideways; set a short Latin range `upright: true` to stack it letter by letter. In an
|
|
112
|
-
area, columns that do not fit past the left edge are `overflow`. Vertical text cannot follow a
|
|
113
|
-
path.
|
|
114
|
-
|
|
115
|
-
- **Clean paths.** Use the fewest anchors that describe the shape: anchors at extrema (top,
|
|
116
|
-
bottom, left, right of a curve) and at true corners, handles horizontal or vertical at extrema,
|
|
117
|
-
each handle about a third of its segment. Run `vector.removeRedundantPoints` after
|
|
118
|
-
booleans, knife and pencil work; `vector.smooth` for lumpy curves; `vector.deleteAnchors`
|
|
119
|
-
keeps the outline by refitting neighbours.
|
|
120
|
-
- **Live corners over drawn arcs.** Give rectangles, polygons and stars a `cornerRadius`
|
|
121
|
-
(`vector.addShape`) or set it with `vector.setCorners`; the anchors stay sharp and editable and
|
|
122
|
-
radii shrink to fit short sides. Keep one radius scale across a design. For app icons and UI
|
|
123
|
-
cards use `smoothing` (about 0.6) on `vector.setCorners` for continuous, squircle corners.
|
|
104
|
+
- **Paths, strokes, booleans, gradients, stacks, masks, shadows, connectors, constraints and
|
|
105
|
+
vertical text:** read [references/best-practices.md](references/best-practices.md) first.
|
|
124
106
|
- **Non-destructive first.** Live booleans (`vector.boolean` with `live: true`), path effects
|
|
125
107
|
and envelopes keep the operands editable. A destructive boolean or Pathfinder replaces its
|
|
126
108
|
inputs; do that last, and only when asked for flat output.
|
|
127
|
-
- **Boolean vs Pathfinder vs Shape Builder.** `vector.boolean` for a single result shape (union
|
|
128
|
-
for silhouettes, subtract for cut-outs, intersect, exclude). `vector.pathfinder` when you need
|
|
129
|
-
every region separately (divide), hidden parts removed (trim, merge) or a crop. Shape Builder
|
|
130
|
-
when you want to merge or delete particular regions picked by point.
|
|
131
|
-
- **Strokes.** Use `strokeAlign: "inside"` for icons and UI shapes so the outer size stays exact,
|
|
132
|
-
`outside` for outlines around artwork; open paths always stroke centred. Use round caps and
|
|
133
|
-
joins for friendly line icons, miter for geometric ones. Keep one stroke width across an icon
|
|
134
|
-
set (for example 1.5 or 2 units on a 24-unit grid).
|
|
135
|
-
- **Icon grid.** Use a square artboard (24, 32 or 48 units), keep a padding margin, place
|
|
136
|
-
coordinates on whole or half units so strokes render crisp, and align optical centres.
|
|
137
|
-
- **Gradients.** Two to four stops are usually enough. Use `interpolation: "oklab"` for
|
|
138
|
-
perceptually even blends without the grey or muddy midpoint sRGB gives between saturated hues;
|
|
139
|
-
`midpoint` to shift the half-way point instead of adding stops. Prefer linear or radial for
|
|
140
|
-
portability; conic and diamond export as SVG patterns.
|
|
141
|
-
- **Appearance stacks over duplicate shapes.** For a gradient over a texture, a tinted overlay,
|
|
142
|
-
an outline around an outline or a stroke inside and another outside, stack layers on one path
|
|
143
|
-
(`vector.addFill`, `vector.addStroke`) instead of copying the shape: the copies would drift
|
|
144
|
-
apart when edited. Give each stroke its own `strokeAlign` (outside under, inside or center on
|
|
145
|
-
top) and widths that step down towards the top. Use per-layer `opacity` and `blendMode`
|
|
146
|
-
(multiply to darken, screen to lighten, overlay for texture) rather than node opacity when only
|
|
147
|
-
one paint should fade.
|
|
148
|
-
- **Masks over cut-outs.** To show artwork inside a shape (a photo-like fill in a circle, a
|
|
149
|
-
pattern inside text-like outlines, a scene seen through a window), use
|
|
150
|
-
`vector.makeClippingMask` rather than a destructive intersect: the contents stay editable and
|
|
151
|
-
movable inside the frame. Draw the mask last (on top) and make the mask from it; edit the mask
|
|
152
|
-
later by its `maskId`. Use `vector.makeOpacityMask` with a white-to-black gradient for fades
|
|
153
|
-
and reflections (luminance: white shows). A clip's own paint is never drawn, so its fill
|
|
154
|
-
colour does not matter. Effects and shadows on the mask group follow the masked silhouette.
|
|
155
|
-
- **Shadows and glows.** Keep drop shadows subtle: black at 0.15 to 0.3 opacity, `offsetY` 2 to 8,
|
|
156
|
-
`blur` about twice the offset. Use one light direction for every shadow in a design. Filters
|
|
157
|
-
export as SVG filters, which some tools (and older renderers) draw slightly differently or not
|
|
158
|
-
at all; a design that must look identical everywhere should avoid them or rasterize.
|
|
159
109
|
- **Grouping and naming.** Group the parts of one object (`vector.group` with a `name`), name
|
|
160
110
|
paths that matter (`name` on add), and keep the tree shallow.
|
|
161
111
|
- **SVG hygiene.** Export with `precision` 2 or 3 (default 3); higher only for tiny artboards.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Drawing best practices
|
|
2
|
+
|
|
3
|
+
Detail for `SKILL.md`'s best practices, by topic.
|
|
4
|
+
|
|
5
|
+
- **Clean paths.** Use the fewest anchors that describe the shape: anchors at extrema (top,
|
|
6
|
+
bottom, left, right of a curve) and at true corners, handles horizontal or vertical at extrema,
|
|
7
|
+
each handle about a third of its segment. Run `vector.removeRedundantPoints` after
|
|
8
|
+
booleans, knife and pencil work; `vector.smooth` for lumpy curves; `vector.deleteAnchors`
|
|
9
|
+
keeps the outline by refitting neighbours.
|
|
10
|
+
- **Live corners over drawn arcs.** Give rectangles, polygons and stars a `cornerRadius`
|
|
11
|
+
(`vector.addShape`) or set it with `vector.setCorners`; the anchors stay sharp and editable and
|
|
12
|
+
radii shrink to fit short sides. Keep one radius scale across a design. For app icons and UI
|
|
13
|
+
cards use `smoothing` (about 0.6) on `vector.setCorners` for continuous, squircle corners.
|
|
14
|
+
- **Boolean vs Pathfinder vs Shape Builder.** `vector.boolean` for a single result shape (union
|
|
15
|
+
for silhouettes, subtract for cut-outs, intersect, exclude). `vector.pathfinder` when you need
|
|
16
|
+
every region separately (divide), hidden parts removed (trim, merge) or a crop. Shape Builder
|
|
17
|
+
when you want to merge or delete particular regions picked by point.
|
|
18
|
+
- **Strokes.** Use `strokeAlign: "inside"` for icons and UI shapes so the outer size stays exact,
|
|
19
|
+
`outside` for outlines around artwork; open paths always stroke centred. Use round caps and
|
|
20
|
+
joins for friendly line icons, miter for geometric ones. Keep one stroke width across an icon
|
|
21
|
+
set (for example 1.5 or 2 units on a 24-unit grid).
|
|
22
|
+
- **Icon grid.** Use a square artboard (24, 32 or 48 units), keep a padding margin, place
|
|
23
|
+
coordinates on whole or half units so strokes render crisp, and align optical centres.
|
|
24
|
+
- **Gradients.** Two to four stops are usually enough. Use `interpolation: "oklab"` for
|
|
25
|
+
perceptually even blends without the grey or muddy midpoint sRGB gives between saturated hues;
|
|
26
|
+
`midpoint` to shift the half-way point instead of adding stops. Prefer linear or radial for
|
|
27
|
+
portability; conic and diamond export as SVG patterns.
|
|
28
|
+
- **Appearance stacks over duplicate shapes.** For a gradient over a texture, a tinted overlay,
|
|
29
|
+
an outline around an outline or a stroke inside and another outside, stack layers on one path
|
|
30
|
+
(`vector.addFill`, `vector.addStroke`) instead of copying the shape: the copies would drift
|
|
31
|
+
apart when edited. Give each stroke its own `strokeAlign` (outside under, inside or center on
|
|
32
|
+
top) and widths that step down towards the top. Use per-layer `opacity` and `blendMode`
|
|
33
|
+
(multiply to darken, screen to lighten, overlay for texture) rather than node opacity when only
|
|
34
|
+
one paint should fade.
|
|
35
|
+
- **Masks over cut-outs.** To show artwork inside a shape (a photo-like fill in a circle, a
|
|
36
|
+
pattern inside text-like outlines, a scene seen through a window), use
|
|
37
|
+
`vector.makeClippingMask` rather than a destructive intersect: the contents stay editable and
|
|
38
|
+
movable inside the frame. Draw the mask last (on top) and make the mask from it; edit the mask
|
|
39
|
+
later by its `maskId`. Use `vector.makeOpacityMask` with a white-to-black gradient for fades
|
|
40
|
+
and reflections (luminance: white shows). A clip's own paint is never drawn, so its fill
|
|
41
|
+
colour does not matter. Effects and shadows on the mask group follow the masked silhouette.
|
|
42
|
+
- **Shadows and glows.** Keep drop shadows subtle: black at 0.15 to 0.3 opacity, `offsetY` 2 to 8,
|
|
43
|
+
`blur` about twice the offset. Use one light direction for every shadow in a design. Filters
|
|
44
|
+
export as SVG filters, which some tools (and older renderers) draw slightly differently or not
|
|
45
|
+
at all; a design that must look identical everywhere should avoid them or rasterize.
|
|
46
|
+
- **Diagrams with connectors.** Lay the boxes out first, then `vector.connect` them (in one
|
|
47
|
+
`run_commands` batch) rather than drawing lines: connectors stay attached when boxes move, and
|
|
48
|
+
`route: "elbow"` with a small `radius` reads well in flowcharts. Leave sides `auto` unless a
|
|
49
|
+
connector must leave a particular side.
|
|
50
|
+
|
|
51
|
+
- **Constraints for precise, editable geometry.** For technical drawings, diagrams, floor plans or
|
|
52
|
+
any shape that must keep exact relations, draw it roughly, run `vector.autoConstrain`, then add
|
|
53
|
+
the dimensions that matter (`vector.addConstraint` distance / angle / radius) and name them so
|
|
54
|
+
related sizes follow one another (`vector.setConstraintValue` with expressions like `w / 2`).
|
|
55
|
+
Check `vector.listConstraints` `dof`: aim for `fully` on parts that must not drift; `over`
|
|
56
|
+
means some constraints repeat others. Prefer few, meaningful constraints over many.
|
|
57
|
+
|
|
58
|
+
- **Vertical text.** For Japanese, Chinese or Korean set in columns (signage, book spines, posters), use vertical
|
|
59
|
+
text (`textOrientation: "vertical"` or `vector.setTextOrientation`): CJK stands upright, Latin
|
|
60
|
+
turns sideways; set a short Latin range `upright: true` to stack it letter by letter. In an
|
|
61
|
+
area, columns that do not fit past the left edge are `overflow`. Vertical text cannot follow a
|
|
62
|
+
path.
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pixerate-vector-icon-set
|
|
3
|
+
description: The icon set workflow in the Pixerate vector editor - drawing line or solid icons on a consistent grid (24, 32 or 48 units) with padding and keylines, one stroke width, cap and join style and corner radius across the set, anchors on whole or half units so they render crisp, clean minimal paths, repeats as symbols, and checking and exporting each icon as SVG. Use when asked to draw, design, redraw, clean up or make consistent an icon or a set of icons, glyphs or pictograms, or to export icons as SVG, or when vector.addPath, vector.setStyle, vector.makeSymbol or vector.exportSvg are available. Load with pixerate-vector, which lists every command.
|
|
4
|
+
metadata:
|
|
5
|
+
kind: workflow
|
|
6
|
+
reference: pixerate-vector
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Drawing an icon set
|
|
10
|
+
|
|
11
|
+
An icon set reads as one family when every icon shares the same few decisions: the grid, the
|
|
12
|
+
padding, the stroke width, the cap and join, the corner radius and the visual weight. Make
|
|
13
|
+
those decisions once, write them down, and apply them to every icon; then check each icon
|
|
14
|
+
against them in numbers (`vector.list` bounds, stroke widths and `d`) before looking.
|
|
15
|
+
|
|
16
|
+
This skill is the method. `pixerate-vector` has the full command reference; run the commands
|
|
17
|
+
with `run_command`, or several as one undo step with `run_commands` and `atomic: true`.
|
|
18
|
+
|
|
19
|
+
## Goal and quality bar
|
|
20
|
+
|
|
21
|
+
- One grid: a square artboard of 24 (UI), 32 or 48 units, the same for the whole set.
|
|
22
|
+
- Padding kept: nothing, stroke included, closer than 2 units to the edge on a 24 grid (1/12 of
|
|
23
|
+
the side on others). Strokes count half their width outside the path.
|
|
24
|
+
- One stroke width (2 on 24 is the common default; 1.5 for a lighter set), one cap and join
|
|
25
|
+
style (round for friendly sets, butt and miter for geometric ones), one corner radius.
|
|
26
|
+
- Crisp: with an even stroke width (2) put the path's anchors on whole units, with an odd one
|
|
27
|
+
(1, 3) on half units, so the stroke's edges fall on pixel boundaries at 1×.
|
|
28
|
+
- Clean paths: the fewest anchors that make the shape, no stray or zero-length segments, no
|
|
29
|
+
hidden overlapping shapes.
|
|
30
|
+
- Visually balanced: icons look the same size (circles a little larger than squares), and are
|
|
31
|
+
optically centred.
|
|
32
|
+
|
|
33
|
+
## Inputs to confirm
|
|
34
|
+
|
|
35
|
+
- **Grid and stroke:** the size (24 by default) and stroke width (2 by default), or an existing
|
|
36
|
+
icon to match (read it first).
|
|
37
|
+
- **Style:** outline (stroked) or solid (filled), and rounded or sharp.
|
|
38
|
+
- **Output:** one SVG per icon, a sprite, or symbols in one document.
|
|
39
|
+
|
|
40
|
+
## Working method
|
|
41
|
+
|
|
42
|
+
1. **Read what exists.** `vector.list`: the artboard size and any icons already drawn, with their
|
|
43
|
+
`strokeWidth`, `bounds` and `d`; `vector.getAppearance` for caps, joins and alignment.
|
|
44
|
+
**Check:** you can state the set's grid, padding, stroke, caps, joins and radius.
|
|
45
|
+
2. **Draw on the grid.** Prefer `vector.addShape` primitives (`rect` with `cornerRadius`,
|
|
46
|
+
`ellipse`, `line`, `polygon`) and `vector.addPath` with whole or half-unit coordinates; give
|
|
47
|
+
`fill: null`, `stroke`, `strokeWidth`, `strokeLinecap` and `strokeLinejoin` in the same call.
|
|
48
|
+
Batch one icon's parts in one `run_commands` with `atomic: true` and a `label`.
|
|
49
|
+
**Check:** `vector.list` bounds plus half the stroke stay inside the padding.
|
|
50
|
+
3. **Combine.** Join parts that should be one shape with `vector.boolean` (`union`; `subtract`
|
|
51
|
+
for cut-outs); use `vector.outlineStroke` only for a solid set or when the export target needs
|
|
52
|
+
fills. Then `vector.removeRedundantPoints`.
|
|
53
|
+
**Check:** `d` has no more anchors than the shape needs; coordinates are still on the grid.
|
|
54
|
+
4. **Match the set.** `vector.setStyle` on all the set's paths at once (`ids` from `vector.list`)
|
|
55
|
+
for stroke width, caps and joins; `vector.setCorners` for one radius.
|
|
56
|
+
**Check:** every path's `strokeWidth` is the set's; caps and joins in `vector.getAppearance`.
|
|
57
|
+
5. **Balance.** Compare the icons' bounds: a circle about 10 % larger than a square of the same
|
|
58
|
+
weight looks the same size; centre shapes optically (a play triangle shifts right).
|
|
59
|
+
**Check:** each icon's bounds centre is within half a unit of the artboard centre (or its
|
|
60
|
+
intended optical centre).
|
|
61
|
+
6. **Repeats become symbols.** The same element used several times (a star in a rating, a
|
|
62
|
+
chevron) is `vector.makeSymbol` once and `vector.placeSymbol` elsewhere.
|
|
63
|
+
7. **Export.** `vector.exportSvg` (or `vector.exportFrameSvg` per artboard) with `precision` 2;
|
|
64
|
+
read the markup: no transforms where plain coordinates would do, no hidden nodes.
|
|
65
|
+
|
|
66
|
+
## Decision table
|
|
67
|
+
|
|
68
|
+
| Need | Approach |
|
|
69
|
+
| --- | --- |
|
|
70
|
+
| Outline icon | Stroked paths, `fill: null`, round caps and joins |
|
|
71
|
+
| Solid icon | Filled shapes; `vector.outlineStroke` turns a stroked sketch into fills |
|
|
72
|
+
| A rounded rectangle or badge | `vector.addShape` `rect` with `cornerRadius`, not drawn arcs |
|
|
73
|
+
| A cut-out (a hole, a notch) | `vector.boolean` `subtract`, or `fillRule: "evenodd"` |
|
|
74
|
+
| Several icons on one page | One frame per icon (`vector.addFrame`), exported with `vector.exportFrameSvg` |
|
|
75
|
+
| One element repeated | `vector.makeSymbol` and `vector.placeSymbol` |
|
|
76
|
+
| Odd stroke width (1, 3) | Put anchors on half units so the edges land on pixels |
|
|
77
|
+
|
|
78
|
+
## Recipes
|
|
79
|
+
|
|
80
|
+
**A line icon.** One `vector.addPath` with `d` on the grid (`M12 5L12 19M5 12L19 12` is a plus
|
|
81
|
+
on 24), `fill: null`, `stroke`, `strokeWidth: 2`, `strokeLinecap: "round"`,
|
|
82
|
+
`strokeLinejoin: "round"`; then `vector.list` to check bounds against the padding.
|
|
83
|
+
|
|
84
|
+
**Make a set consistent.** `vector.list` → `vector.setStyle` with every path's id, the set's
|
|
85
|
+
`strokeWidth`, `strokeLinecap` and `strokeLinejoin` in one call (one undo step) → `vector.list`
|
|
86
|
+
to confirm nothing moved.
|
|
87
|
+
|
|
88
|
+
**Copies into a symbol.** `vector.makeSymbol` on the first copy (it is replaced by an
|
|
89
|
+
instance), `vector.delete` the other copies, `vector.placeSymbol` at their centres.
|
|
90
|
+
|
|
91
|
+
## Pitfalls
|
|
92
|
+
|
|
93
|
+
- **Bounds without the stroke.** `vector.list` bounds are the path's geometry; add half the
|
|
94
|
+
stroke width on each side when checking padding.
|
|
95
|
+
- **Off-grid anchors** after a scale or rotate blur at 1×; check `d` and round coordinates.
|
|
96
|
+
- **Default styles.** `vector.addShape` adds a grey fill and a dark 2-unit stroke unless you pass
|
|
97
|
+
`fill` and `stroke`; set them in the same call.
|
|
98
|
+
- **Scaling strokes.** Scaling an icon scales its geometry, not its stroke width; reset
|
|
99
|
+
`strokeWidth` afterwards so the set stays consistent.
|
|
100
|
+
- **Too many anchors** from booleans or traced input; `vector.removeRedundantPoints`.
|
|
101
|
+
- **Mixed caps and joins** across a set are easy to miss by eye; read `vector.getAppearance`.
|
|
102
|
+
|
|
103
|
+
## Tools used
|
|
104
|
+
|
|
105
|
+
- `vector.list`, `vector.getAppearance`: bounds, stroke widths, `d`, caps and joins
|
|
106
|
+
- `vector.addShape`, `vector.addPath`: draw on the grid
|
|
107
|
+
- `vector.setStyle`, `vector.setCorners`: one stroke, cap, join and radius across the set
|
|
108
|
+
- `vector.boolean`, `vector.outlineStroke`, `vector.removeRedundantPoints`: combine and clean paths
|
|
109
|
+
- `vector.transform`, `vector.align`: position and centre
|
|
110
|
+
- `vector.makeSymbol`, `vector.placeSymbol`, `vector.delete`: repeats as symbols
|
|
111
|
+
- `vector.addFrame`, `vector.exportFrameSvg`, `vector.exportSvg`: one artboard per icon, export
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"prompt": "These three icons are from one set but their stroke widths don't match (1, 2 and 3 units). Make them all 2 units with round caps and joins, without moving or resizing them.",
|
|
3
|
+
"fixture": {
|
|
4
|
+
"editor": "vector",
|
|
5
|
+
"width": 72,
|
|
6
|
+
"height": 24,
|
|
7
|
+
"setup": [
|
|
8
|
+
{ "id": "vector.addPath", "params": { "d": "M4 12L20 12", "name": "Minus", "fill": null, "stroke": "#000", "strokeWidth": 1 } },
|
|
9
|
+
{ "id": "vector.addPath", "params": { "d": "M28 6L44 18M44 6L28 18", "name": "Close", "fill": null, "stroke": "#000", "strokeWidth": 2 } },
|
|
10
|
+
{ "id": "vector.addPath", "params": { "d": "M52 12L58 18L68 6", "name": "Check", "fill": null, "stroke": "#000", "strokeWidth": 3 } }
|
|
11
|
+
]
|
|
12
|
+
},
|
|
13
|
+
"checks": [
|
|
14
|
+
{ "why": "every icon at 2 units", "tool": "run_command", "args": { "id": "vector.list" }, "expect": { "result": { "nodes": { "$length": 3, "$every": { "strokeWidth": 2 } } } } },
|
|
15
|
+
{ "why": "the icons have not moved or changed size", "tool": "run_command", "args": { "id": "vector.list" }, "expect": { "result": { "nodes": [{ "name": "Minus", "bounds": { "x": 4, "y": 12, "width": 16, "height": 0 } }, { "name": "Close", "bounds": { "x": 28, "y": 6, "width": 16, "height": 12 } }, { "name": "Check", "bounds": { "x": 52, "y": 6, "width": 16, "height": 12 } }] } } },
|
|
16
|
+
{ "why": "round caps on the minus too", "tool": "run_command", "args": { "id": "vector.getAppearance", "params": { "id": { "$read": "run_command", "args": { "id": "vector.list" }, "path": "result.nodes.0.id" } } }, "expect": { "result": { "strokes": { "$every": { "strokeLinecap": "round", "strokeLinejoin": "round" } } } } }
|
|
17
|
+
],
|
|
18
|
+
"solution": [
|
|
19
|
+
{ "tool": "run_command", "args": { "id": "vector.list" } },
|
|
20
|
+
{ "tool": "run_command", "args": { "id": "vector.setStyle", "params": { "ids": { "$read": "run_command", "args": { "id": "vector.list" }, "path": "result.nodes.*.id" }, "strokeWidth": 2, "strokeLinecap": "round", "strokeLinejoin": "round" } } }
|
|
21
|
+
]
|
|
22
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"prompt": "Draw a 'plus' line icon on this 24-unit icon grid: 2-unit strokes with round caps, no fill, centred, keeping a 2-unit padding around it.",
|
|
3
|
+
"fixture": { "editor": "vector", "width": 24, "height": 24 },
|
|
4
|
+
"checks": [
|
|
5
|
+
{ "why": "a stroked, unfilled path at the set's stroke width", "tool": "run_command", "args": { "id": "vector.list" }, "expect": { "result": { "nodes": { "$some": { "type": "path", "fill": null, "strokeWidth": 2 } } } } },
|
|
6
|
+
{ "why": "every stroke stays inside the 2-unit padding", "tool": "run_command", "args": { "id": "vector.list" }, "expect": { "result": { "nodes": { "$length": { "$min": 1 }, "$every": { "$expr": "!v.bounds || (v.bounds.x - (v.strokeWidth || 0) / 2 >= 1.99 && v.bounds.y - (v.strokeWidth || 0) / 2 >= 1.99 && v.bounds.x + v.bounds.width + (v.strokeWidth || 0) / 2 <= 22.01 && v.bounds.y + v.bounds.height + (v.strokeWidth || 0) / 2 <= 22.01)" } } } } },
|
|
7
|
+
{ "why": "centred on the grid", "tool": "run_command", "args": { "id": "vector.list" }, "expect": { "result": { "nodes": { "$some": { "type": "path", "bounds": { "$expr": "Math.abs(v.x + v.width / 2 - 12) <= 0.5 && Math.abs(v.y + v.height / 2 - 12) <= 0.5 && Math.abs(v.width - v.height) <= 0.5" } } } } } },
|
|
8
|
+
{ "why": "anchors on whole or half units, so strokes render crisp", "tool": "run_command", "args": { "id": "vector.list" }, "expect": { "result": { "nodes": { "$every": { "$expr": "!v.d || (v.d.match(/-?\\d*\\.?\\d+/g) || []).every((n) => Math.abs(n * 2 - Math.round(n * 2)) < 1e-6)" } } } } },
|
|
9
|
+
{ "why": "round caps", "tool": "run_command", "args": { "id": "vector.getAppearance", "params": { "id": { "$read": "run_command", "args": { "id": "vector.list" }, "path": "result.nodes.0.id" } } }, "expect": { "result": { "strokes": { "$some": { "strokeLinecap": "round" } } } } }
|
|
10
|
+
],
|
|
11
|
+
"solution": [
|
|
12
|
+
{ "tool": "run_command", "args": { "id": "vector.addPath", "params": { "d": "M12 5L12 19M5 12L19 12", "name": "Plus", "fill": null, "stroke": "#000000", "strokeWidth": 2, "strokeLinecap": "round", "strokeLinejoin": "round" } } },
|
|
13
|
+
{ "tool": "run_command", "args": { "id": "vector.list" } }
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
{
|
|
2
|
+
"prompt": "The three stars are copies of the same rating icon. Make them one reusable symbol, so that editing it once updates all three, and keep them where they are.",
|
|
3
|
+
"fixture": {
|
|
4
|
+
"editor": "vector",
|
|
5
|
+
"width": 72,
|
|
6
|
+
"height": 24,
|
|
7
|
+
"setup": [
|
|
8
|
+
{
|
|
9
|
+
"id": "vector.addShape",
|
|
10
|
+
"params": {
|
|
11
|
+
"kind": "star",
|
|
12
|
+
"x": 2,
|
|
13
|
+
"y": 2,
|
|
14
|
+
"width": 20,
|
|
15
|
+
"height": 20,
|
|
16
|
+
"name": "Star",
|
|
17
|
+
"fill": "#f5b301",
|
|
18
|
+
"stroke": null
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"id": "vector.addShape",
|
|
23
|
+
"params": {
|
|
24
|
+
"kind": "star",
|
|
25
|
+
"x": 26,
|
|
26
|
+
"y": 2,
|
|
27
|
+
"width": 20,
|
|
28
|
+
"height": 20,
|
|
29
|
+
"name": "Star",
|
|
30
|
+
"fill": "#f5b301",
|
|
31
|
+
"stroke": null
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"id": "vector.addShape",
|
|
36
|
+
"params": {
|
|
37
|
+
"kind": "star",
|
|
38
|
+
"x": 50,
|
|
39
|
+
"y": 2,
|
|
40
|
+
"width": 20,
|
|
41
|
+
"height": 20,
|
|
42
|
+
"name": "Star",
|
|
43
|
+
"fill": "#f5b301",
|
|
44
|
+
"stroke": null
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
"checks": [
|
|
50
|
+
{
|
|
51
|
+
"why": "one symbol",
|
|
52
|
+
"tool": "run_command",
|
|
53
|
+
"args": {
|
|
54
|
+
"id": "vector.listSymbols"
|
|
55
|
+
},
|
|
56
|
+
"expect": {
|
|
57
|
+
"result": {
|
|
58
|
+
"symbols": {
|
|
59
|
+
"$length": 1
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"why": "three instances of it and no loose copies",
|
|
66
|
+
"tool": "run_command",
|
|
67
|
+
"args": {
|
|
68
|
+
"id": "vector.list"
|
|
69
|
+
},
|
|
70
|
+
"expect": {
|
|
71
|
+
"result": {
|
|
72
|
+
"nodes": {
|
|
73
|
+
"$length": 3,
|
|
74
|
+
"$every": {
|
|
75
|
+
"type": "instance"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"why": "in their original places",
|
|
83
|
+
"tool": "run_command",
|
|
84
|
+
"args": {
|
|
85
|
+
"id": "vector.list"
|
|
86
|
+
},
|
|
87
|
+
"expect": {
|
|
88
|
+
"result": {
|
|
89
|
+
"nodes": {
|
|
90
|
+
"$expr": "[2, 26, 50].every((x) => v.some((n) => Math.abs(n.bounds.x + n.bounds.width / 2 - (x + 10)) <= 0.5))"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
],
|
|
96
|
+
"solution": [
|
|
97
|
+
{
|
|
98
|
+
"tool": "run_command",
|
|
99
|
+
"args": {
|
|
100
|
+
"id": "vector.list"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"tool": "run_command",
|
|
105
|
+
"args": {
|
|
106
|
+
"id": "vector.makeSymbol",
|
|
107
|
+
"params": {
|
|
108
|
+
"ids": [
|
|
109
|
+
{
|
|
110
|
+
"$read": "run_command",
|
|
111
|
+
"args": {
|
|
112
|
+
"id": "vector.list"
|
|
113
|
+
},
|
|
114
|
+
"path": "result.nodes.0.id"
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
"name": "Rating star"
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"tool": "run_command",
|
|
123
|
+
"args": {
|
|
124
|
+
"id": "vector.delete",
|
|
125
|
+
"params": {
|
|
126
|
+
"ids": [
|
|
127
|
+
{
|
|
128
|
+
"$read": "run_command",
|
|
129
|
+
"args": {
|
|
130
|
+
"id": "vector.list"
|
|
131
|
+
},
|
|
132
|
+
"path": "result.nodes.1.id"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"$read": "run_command",
|
|
136
|
+
"args": {
|
|
137
|
+
"id": "vector.list"
|
|
138
|
+
},
|
|
139
|
+
"path": "result.nodes.2.id"
|
|
140
|
+
}
|
|
141
|
+
]
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"tool": "run_command",
|
|
147
|
+
"args": {
|
|
148
|
+
"id": "vector.placeSymbol",
|
|
149
|
+
"params": {
|
|
150
|
+
"symbolId": {
|
|
151
|
+
"$read": "run_command",
|
|
152
|
+
"args": {
|
|
153
|
+
"id": "vector.listSymbols"
|
|
154
|
+
},
|
|
155
|
+
"path": "result.symbols.0.id"
|
|
156
|
+
},
|
|
157
|
+
"x": 36,
|
|
158
|
+
"y": {
|
|
159
|
+
"$read": "run_command",
|
|
160
|
+
"args": {
|
|
161
|
+
"id": "vector.list"
|
|
162
|
+
},
|
|
163
|
+
"path": "result.nodes.0.transform.5"
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"tool": "run_command",
|
|
170
|
+
"args": {
|
|
171
|
+
"id": "vector.placeSymbol",
|
|
172
|
+
"params": {
|
|
173
|
+
"symbolId": {
|
|
174
|
+
"$read": "run_command",
|
|
175
|
+
"args": {
|
|
176
|
+
"id": "vector.listSymbols"
|
|
177
|
+
},
|
|
178
|
+
"path": "result.symbols.0.id"
|
|
179
|
+
},
|
|
180
|
+
"x": 60,
|
|
181
|
+
"y": {
|
|
182
|
+
"$read": "run_command",
|
|
183
|
+
"args": {
|
|
184
|
+
"id": "vector.list"
|
|
185
|
+
},
|
|
186
|
+
"path": "result.nodes.0.transform.5"
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
]
|
|
192
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pixerate-vector-illustration
|
|
3
|
+
description: The illustration workflow in the Pixerate vector editor - blocking in shapes back to front, grouping and naming parts, colour from a small palette, gradients (linear, radial, mesh and freeform) with even interpolation, stacked fills and strokes instead of duplicate shapes, clipping and opacity masks, blends, subtle shadows and glows with one light direction, and preparing artboards for export. Use when asked to draw, illustrate or paint a scene, character, object, spot illustration, poster or background in vector, add shading, gradients, highlights, shadows or texture, show art inside a shape, or when vector.setGradient, vector.addFill, vector.makeClippingMask, vector.addFilter or vector.blend are available. Load with pixerate-vector, which lists every command.
|
|
4
|
+
metadata:
|
|
5
|
+
kind: workflow
|
|
6
|
+
reference: pixerate-vector
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Making an illustration
|
|
10
|
+
|
|
11
|
+
An illustration is built like a painting: big shapes first, back to front, then form (light and
|
|
12
|
+
shade), then detail, then finish. In vector, every stage should stay editable: shading lives in
|
|
13
|
+
gradients and stacked fills rather than extra shapes, art shown inside a shape lives in masks,
|
|
14
|
+
and effects stay live until the file is delivered.
|
|
15
|
+
|
|
16
|
+
This skill is the method. `pixerate-vector` has the full command reference; run the commands
|
|
17
|
+
with `run_command`, or several as one undo step with `run_commands` and `atomic: true`.
|
|
18
|
+
|
|
19
|
+
## Goal and quality bar
|
|
20
|
+
|
|
21
|
+
- A clear structure: parts grouped and named ("Sky", "Hill far", "Tree 1"), stacked back to
|
|
22
|
+
front, the tree shallow.
|
|
23
|
+
- A small palette (5-8 colours plus tints), used consistently; gradients two to four stops.
|
|
24
|
+
- One light direction for every highlight, shade and shadow.
|
|
25
|
+
- Non-destructive: gradients, appearance stacks, masks, blends and filters are live; shapes are
|
|
26
|
+
not duplicated to fake shading.
|
|
27
|
+
- Shadows and glows subtle: drop shadows black at 0.15-0.3 opacity, offset 2-8 units straight
|
|
28
|
+
away from the light, blur about twice the offset.
|
|
29
|
+
|
|
30
|
+
## Inputs to confirm
|
|
31
|
+
|
|
32
|
+
- **Subject and format:** what to draw, the artboard size or ratio.
|
|
33
|
+
- **Style:** flat (solid fills), soft (gradients), or textured; outlined or not.
|
|
34
|
+
- **Palette:** brand colours or free; the light direction if it matters.
|
|
35
|
+
|
|
36
|
+
## Working method
|
|
37
|
+
|
|
38
|
+
1. **Read and plan.** `vector.list` for the artboard and what exists. Plan the layers from back to
|
|
39
|
+
front (sky, far, middle, near, foreground details) and the palette.
|
|
40
|
+
2. **Block in.** Big shapes with `vector.addShape` and `vector.addPath`, flat colours, one
|
|
41
|
+
`run_commands` per group with `atomic: true`; `vector.group` each object with a `name`.
|
|
42
|
+
**Check:** `vector.list` order is back to front; names say what each group is.
|
|
43
|
+
3. **Form.** Shade with gradients rather than extra shapes: `vector.setStyle` `fill` with a
|
|
44
|
+
`linear` or `radial` gradient (`interpolation: "oklab"` for clean blends between saturated
|
|
45
|
+
colours), `vector.setGradient` to place it, `vector.setMeshGradient` or
|
|
46
|
+
`vector.setFreeformGradient` for organic shading. For a highlight or a texture over a fill,
|
|
47
|
+
`vector.addFill` on the same path with its own `opacity` and `blendMode` (screen to lighten,
|
|
48
|
+
multiply to darken).
|
|
49
|
+
**Check:** `vector.getAppearance` shows the stack; the shape count did not grow.
|
|
50
|
+
4. **Masks for art inside shapes.** Put the shape that frames the art on top and
|
|
51
|
+
`vector.makeClippingMask` with the art below it (a pattern in a window, a scene in a circle);
|
|
52
|
+
`vector.makeOpacityMask` with a white-to-black gradient for fades and reflections.
|
|
53
|
+
**Check:** `vector.list` shows the mask group's `mask` with the right `contents`.
|
|
54
|
+
5. **Transitions and repeats.** `vector.blend` between two shapes for smooth steps (a sunset of
|
|
55
|
+
bands, a row of fading circles); symbols for repeated objects (trees, stars).
|
|
56
|
+
6. **Shadows and glows.** `vector.addFilter` `dropShadow` (`offsetX` 0 and `offsetY` positive for
|
|
57
|
+
light from above), `outerGlow` for light sources, `layerBlur` for depth of field.
|
|
58
|
+
**Check:** `vector.list` `filters` show one light direction across the design.
|
|
59
|
+
7. **Finish and export.** Review the stack, then `vector.exportSvg` (or `vector.exportFrameSvg`
|
|
60
|
+
per artboard). Expand live effects (`vector.expandAppearance`, `vector.expandBlend`) only for
|
|
61
|
+
targets that need plain SVG.
|
|
62
|
+
|
|
63
|
+
## Decision table
|
|
64
|
+
|
|
65
|
+
| Want | Approach |
|
|
66
|
+
| --- | --- |
|
|
67
|
+
| Roundness on a ball, sun or face | Radial gradient, light stop toward the light |
|
|
68
|
+
| Sky or ground fading | Linear gradient, two or three stops |
|
|
69
|
+
| Organic shading (fabric, a face) | Mesh or freeform gradient |
|
|
70
|
+
| A highlight or texture over a colour | `vector.addFill` stacked on the same path, screen or overlay |
|
|
71
|
+
| An outline around an outline | `vector.addStroke` stacked, each with its own `strokeAlign` |
|
|
72
|
+
| Art visible only inside a shape | `vector.makeClippingMask` (the frame on top) |
|
|
73
|
+
| A fade-out or reflection | `vector.makeOpacityMask` with a white-to-black gradient |
|
|
74
|
+
| Even steps between two shapes | `vector.blend` |
|
|
75
|
+
| Card or object lifted off the page | `vector.addFilter` `dropShadow`, subtle |
|
|
76
|
+
|
|
77
|
+
## Recipes
|
|
78
|
+
|
|
79
|
+
**Radial shading.** `vector.setStyle` with `fill: { type: "radial", interpolation: "oklab",
|
|
80
|
+
stops: [{ offset: 0, color: light }, { offset: 1, color: dark }] }`; move the centre toward the
|
|
81
|
+
light with `vector.setGradient`.
|
|
82
|
+
|
|
83
|
+
**Pattern in a window.** Draw the pattern, draw the window shape on top, then
|
|
84
|
+
`vector.makeClippingMask` with all their ids: the window clips, its own fill is not drawn, and
|
|
85
|
+
the pattern stays movable inside.
|
|
86
|
+
|
|
87
|
+
**Subtle shadow.** `vector.addFilter` `{ type: "dropShadow", params: { color: "#000000",
|
|
88
|
+
opacity: 0.2, offsetX: 0, offsetY: 4, blur: 8 } }` on the object.
|
|
89
|
+
|
|
90
|
+
## Pitfalls
|
|
91
|
+
|
|
92
|
+
- **Duplicates for shading.** A copied shape for a highlight drifts when the original is edited;
|
|
93
|
+
stack a fill instead.
|
|
94
|
+
- **Muddy gradients.** sRGB interpolation between saturated hues passes through grey; use
|
|
95
|
+
`oklab`, or add a midpoint stop.
|
|
96
|
+
- **Mixed light directions** make a scene look collaged; keep every shadow offset the same way.
|
|
97
|
+
- **Heavy shadows.** Dark, hard, far shadows look pasted on.
|
|
98
|
+
- **The mask on the wrong layer.** `vector.makeClippingMask` uses the topmost object as the mask
|
|
99
|
+
unless `maskId` says otherwise; put the frame on top first.
|
|
100
|
+
- **Filters in exports.** SVG filters render differently in some tools; expand or rasterize where
|
|
101
|
+
the result must look identical everywhere.
|
|
102
|
+
|
|
103
|
+
## Tools used
|
|
104
|
+
|
|
105
|
+
- `vector.list`, `vector.getAppearance`: structure, order, fills, masks and filters
|
|
106
|
+
- `vector.addShape`, `vector.addPath`, `vector.group`, `vector.moveLayer`: block in, group and order
|
|
107
|
+
- `vector.setStyle`, `vector.setGradient`, `vector.setMeshGradient`, `vector.setFreeformGradient`: colour and gradients
|
|
108
|
+
- `vector.addFill`, `vector.addStroke`, `vector.setBlendMode`: appearance stacks
|
|
109
|
+
- `vector.makeClippingMask`, `vector.makeOpacityMask`, `vector.setMaskOptions`: masks
|
|
110
|
+
- `vector.blend`, `vector.makeSymbol`, `vector.placeSymbol`: transitions and repeats
|
|
111
|
+
- `vector.addFilter`, `vector.updateFilter`: shadows, glows and blur
|
|
112
|
+
- `vector.expandAppearance`, `vector.expandBlend`, `vector.exportSvg`, `vector.exportFrameSvg`: finish and export
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"prompt": "Show the stripes only inside the round window, and keep the stripes movable inside it.",
|
|
3
|
+
"fixture": {
|
|
4
|
+
"editor": "vector",
|
|
5
|
+
"width": 100,
|
|
6
|
+
"height": 100,
|
|
7
|
+
"setup": [
|
|
8
|
+
{ "id": "vector.addShape", "params": { "kind": "rect", "x": 10, "y": 10, "width": 16, "height": 80, "name": "Stripe", "fill": "#457b9d", "stroke": null } },
|
|
9
|
+
{ "id": "vector.addShape", "params": { "kind": "rect", "x": 42, "y": 10, "width": 16, "height": 80, "name": "Stripe", "fill": "#457b9d", "stroke": null } },
|
|
10
|
+
{ "id": "vector.addShape", "params": { "kind": "rect", "x": 74, "y": 10, "width": 16, "height": 80, "name": "Stripe", "fill": "#457b9d", "stroke": null } },
|
|
11
|
+
{ "id": "vector.addShape", "params": { "kind": "ellipse", "x": 20, "y": 20, "width": 60, "height": 60, "name": "Window", "fill": "#ffffff", "stroke": null } }
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
"checks": [
|
|
15
|
+
{ "why": "a clipping mask using the window, with all three stripes inside", "tool": "run_command", "args": { "id": "vector.list" }, "expect": { "result": { "nodes": { "$some": { "mask": { "type": "clip", "enabled": true, "contents": { "$length": 3 } } } } } } },
|
|
16
|
+
{ "why": "the stripes are still separate, editable paths", "tool": "run_command", "args": { "id": "vector.list" }, "expect": { "result": { "nodes": { "$expr": "v.filter((n) => n.name === 'Stripe' && n.type === 'path').length === 3" } } } }
|
|
17
|
+
],
|
|
18
|
+
"solution": [
|
|
19
|
+
{ "tool": "run_command", "args": { "id": "vector.makeClippingMask", "params": { "ids": { "$read": "run_command", "args": { "id": "vector.list" }, "path": "result.nodes.*.id" } } } }
|
|
20
|
+
]
|
|
21
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"prompt": "Give the sun a soft radial gradient: yellow in the middle fading to orange at the edge.",
|
|
3
|
+
"fixture": {
|
|
4
|
+
"editor": "vector",
|
|
5
|
+
"width": 100,
|
|
6
|
+
"height": 100,
|
|
7
|
+
"setup": [{ "id": "vector.addShape", "params": { "kind": "ellipse", "x": 30, "y": 30, "width": 40, "height": 40, "name": "Sun", "fill": "#ffcc00", "stroke": null } }]
|
|
8
|
+
},
|
|
9
|
+
"checks": [
|
|
10
|
+
{ "why": "a radial gradient from yellow at the centre to orange at the edge", "tool": "run_command", "args": { "id": "vector.list" }, "expect": { "result": { "nodes": { "$some": { "name": "Sun", "fill": { "$expr": "v && v.type === 'radial' && v.stops.length >= 2 && v.stops[0].offset === 0 && v.stops[v.stops.length - 1].offset === 1" } } } } } },
|
|
11
|
+
{ "why": "the sun is still the same shape and place", "tool": "run_command", "args": { "id": "vector.list" }, "expect": { "result": { "nodes": { "$some": { "name": "Sun", "bounds": { "x": 30, "y": 30, "width": 40, "height": 40 } } } } } }
|
|
12
|
+
],
|
|
13
|
+
"solution": [
|
|
14
|
+
{ "tool": "run_command", "args": { "id": "vector.setStyle", "params": { "ids": { "$read": "run_command", "args": { "id": "vector.list" }, "path": "result.nodes.*.id" }, "fill": { "type": "radial", "interpolation": "oklab", "stops": [{ "offset": 0, "color": "#ffe14d" }, { "offset": 1, "color": "#ff8c1a" }] } } } }
|
|
15
|
+
]
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"prompt": "Add a subtle drop shadow under the card, with the light coming from above.",
|
|
3
|
+
"fixture": {
|
|
4
|
+
"editor": "vector",
|
|
5
|
+
"width": 200,
|
|
6
|
+
"height": 140,
|
|
7
|
+
"setup": [{ "id": "vector.addShape", "params": { "kind": "rect", "x": 40, "y": 30, "width": 120, "height": 80, "cornerRadius": 8, "name": "Card", "fill": "#ffffff", "stroke": null } }]
|
|
8
|
+
},
|
|
9
|
+
"checks": [
|
|
10
|
+
{ "why": "a soft, faint shadow falling straight down", "tool": "run_command", "args": { "id": "vector.list" }, "expect": { "result": { "nodes": { "$some": { "name": "Card", "filters": { "$some": { "type": "dropShadow", "params": { "opacity": { "$min": 0.08, "$max": 0.35 }, "offsetX": { "$min": -1, "$max": 1 }, "offsetY": { "$min": 2, "$max": 10 }, "blur": { "$min": 3 } } } } } } } } },
|
|
11
|
+
{ "why": "drawn as an effect: still one card, no extra shadow shape", "tool": "run_command", "args": { "id": "vector.list" }, "expect": { "result": { "nodes": { "$length": 1 } } } }
|
|
12
|
+
],
|
|
13
|
+
"solution": [
|
|
14
|
+
{ "tool": "run_command", "args": { "id": "vector.addFilter", "params": { "ids": { "$read": "run_command", "args": { "id": "vector.list" }, "path": "result.nodes.*.id" }, "type": "dropShadow", "params": { "color": "#000000", "opacity": 0.2, "offsetX": 0, "offsetY": 4, "blur": 8 } } } }
|
|
15
|
+
]
|
|
16
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pixerate-vector-logo
|
|
3
|
+
description: The logo workflow in the Pixerate vector editor - building a mark from primitives with live booleans, Pathfinder and Shape Builder, optical corrections, a lockup of mark and wordmark aligned and spaced on the artboard, text converted to outlines for the final file, colour variants (full colour, one colour, reversed) through symbols, and clean single-path SVG export. Use when asked to design, draw, redraw, vectorise, clean up or export a logo, logomark, wordmark, monogram, emblem or brand mark, make a one-colour or reversed version, or prepare a logo file for print or the web, or when vector.boolean, vector.pathfinder, vector.createOutlines or vector.exportSvg are available. Load with pixerate-vector, which lists every command.
|
|
4
|
+
metadata:
|
|
5
|
+
kind: workflow
|
|
6
|
+
reference: pixerate-vector
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Making a logo
|
|
10
|
+
|
|
11
|
+
A logo has to survive every size and every background, so it is built from few, clean shapes,
|
|
12
|
+
kept editable while it is being designed and flattened only for delivery. Design with live
|
|
13
|
+
booleans and real text; deliver plain paths with text outlined, one file per variant.
|
|
14
|
+
|
|
15
|
+
This skill is the method. `pixerate-vector` has the full command reference; run the commands
|
|
16
|
+
with `run_command`, or several as one undo step with `run_commands` and `atomic: true`.
|
|
17
|
+
|
|
18
|
+
## Goal and quality bar
|
|
19
|
+
|
|
20
|
+
- The mark is built from simple geometry: primitives combined with booleans, with as few anchors
|
|
21
|
+
as the shape needs.
|
|
22
|
+
- It reads at 16 px and at poster size: no hairlines thinner than about 1/30 of the mark's
|
|
23
|
+
height, no details that close up when small.
|
|
24
|
+
- The lockup is aligned on the artboard: mark and wordmark centred (or aligned to a shared edge),
|
|
25
|
+
with a deliberate gap kept in every variant.
|
|
26
|
+
- Delivery files are self-contained: text outlined (`vector.createOutlines`), live booleans and
|
|
27
|
+
effects expanded, one path per colour where possible, no hidden or stray nodes.
|
|
28
|
+
- Variants match: full colour, one colour (black) and reversed (white on dark) are the same
|
|
29
|
+
geometry.
|
|
30
|
+
|
|
31
|
+
## Inputs to confirm
|
|
32
|
+
|
|
33
|
+
- **Name and wording** for the wordmark, and the typeface (`vector.listFonts`).
|
|
34
|
+
- **Colours:** the brand palette as hex, and which variants are needed.
|
|
35
|
+
- **Stage:** still designing (keep live) or delivering (flatten and outline).
|
|
36
|
+
|
|
37
|
+
## Working method
|
|
38
|
+
|
|
39
|
+
1. **Read.** `vector.list`: the artboard, existing shapes and text, their fills and bounds.
|
|
40
|
+
**Check:** you know which nodes are the mark and which the wordmark.
|
|
41
|
+
2. **Build the mark from primitives.** `vector.addShape` (rect, ellipse, polygon, star) on round
|
|
42
|
+
numbers; combine with `vector.boolean` and `live: true` while designing (`union` for one
|
|
43
|
+
silhouette, `subtract` for cut-outs, `intersect`); `vector.pathfinder` when you need every
|
|
44
|
+
region (`divide`) or `vector.shapeBuilder` to merge chosen regions.
|
|
45
|
+
**Check:** `vector.list` shows the live group with its `liveBoolean` and the expected bounds.
|
|
46
|
+
3. **Correct optically.** Round shapes overshoot flat ones by 2-3 % so they look the same height;
|
|
47
|
+
a horizontal bar looks thicker than a vertical one of equal width, so thin it slightly;
|
|
48
|
+
centre by eye mass (a triangle's centroid, not its box).
|
|
49
|
+
4. **Set the wordmark** with `vector.addText` (point text) and `vector.setTextStyle` for tracking;
|
|
50
|
+
keep it as text while designing.
|
|
51
|
+
**Check:** the text result's `overflow` is empty and `missingFonts` lists nothing.
|
|
52
|
+
5. **Lock it up.** Position mark and wordmark with `vector.transform` (`dx`, `dy`) or
|
|
53
|
+
`vector.align`, then group them (`vector.group` with a `name`).
|
|
54
|
+
**Check:** `vector.list` bounds: centres equal (or edges aligned), the gap what you intended.
|
|
55
|
+
6. **Variants.** Make the lockup a symbol (`vector.makeSymbol`) and place it once per variant
|
|
56
|
+
(`vector.placeSymbol`), recolouring with `vector.setInstanceOptions` `fill`, so a geometry
|
|
57
|
+
change updates every variant. Check each against its background colour (contrast).
|
|
58
|
+
7. **Deliver.** For each variant: `vector.createOutlines` on the text, `vector.expandAppearance`
|
|
59
|
+
on live booleans and effects (or `vector.boolean` without `live` for one path),
|
|
60
|
+
`vector.removeRedundantPoints`, then `vector.exportSvg` with `precision` 2.
|
|
61
|
+
**Check:** `vector.list` has only plain paths; the SVG has no `text` and no filters.
|
|
62
|
+
|
|
63
|
+
## Decision table
|
|
64
|
+
|
|
65
|
+
| Want | Command |
|
|
66
|
+
| --- | --- |
|
|
67
|
+
| One silhouette from overlapping shapes, still editable | `vector.boolean` `union`, `live: true` |
|
|
68
|
+
| A hole or notch | `vector.boolean` `subtract` (top shape cuts the one below) |
|
|
69
|
+
| Every overlap as its own piece | `vector.pathfinder` `divide` |
|
|
70
|
+
| Merge or remove particular regions | `vector.shapeBuilder` |
|
|
71
|
+
| A ring or donut for export | `vector.boolean` `subtract` without `live`: one path with two subpaths |
|
|
72
|
+
| Same logo in several colours | A symbol, with `vector.setInstanceOptions` per variant |
|
|
73
|
+
| Text that must not depend on fonts | `vector.createOutlines` (keep a text copy while designing) |
|
|
74
|
+
|
|
75
|
+
## Recipes
|
|
76
|
+
|
|
77
|
+
**Live union.** `vector.boolean` `{ operation: "union", live: true, ids }` with the parts'
|
|
78
|
+
ids from `vector.list`; adjust a part later by its own id inside the group.
|
|
79
|
+
|
|
80
|
+
**Knockout for export.** `vector.boolean` `{ operation: "subtract", ids: [outer, inner] }`: one
|
|
81
|
+
path, the hole see-through (not painted white).
|
|
82
|
+
|
|
83
|
+
**Centre a lockup.** For each part, `dx = artboard.width / 2 - (bounds.x + bounds.width / 2)`
|
|
84
|
+
with `vector.transform`; leave `dy` at 0 to keep the vertical gap.
|
|
85
|
+
|
|
86
|
+
## Pitfalls
|
|
87
|
+
|
|
88
|
+
- **White shapes as holes.** A white circle over a red one is not a hole; it shows on a coloured
|
|
89
|
+
background. Subtract it.
|
|
90
|
+
- **Flattening too early.** A destructive boolean or outlined text cannot be re-edited; keep live
|
|
91
|
+
versions until delivery.
|
|
92
|
+
- **Live effects in delivered files.** Filters and live booleans export as SVG filters or
|
|
93
|
+
Pixerate attributes that other tools may not read; expand first.
|
|
94
|
+
- **Missing fonts.** A family the shaper lacks draws in a fallback; check `missingFonts` before
|
|
95
|
+
outlining, since outlines bake whatever was drawn.
|
|
96
|
+
- **Hairlines and tiny counters** disappear at favicon size; test the mark small.
|
|
97
|
+
|
|
98
|
+
## Tools used
|
|
99
|
+
|
|
100
|
+
- `vector.list`, `vector.getText`, `vector.listFonts`: read shapes, text and fonts
|
|
101
|
+
- `vector.addShape`, `vector.addPath`, `vector.addText`, `vector.setTextStyle`: build the mark and wordmark
|
|
102
|
+
- `vector.boolean`, `vector.pathfinder`, `vector.shapeBuilder`: combine shapes
|
|
103
|
+
- `vector.transform`, `vector.align`, `vector.group`: lock up and space
|
|
104
|
+
- `vector.makeSymbol`, `vector.placeSymbol`, `vector.setInstanceOptions`: colour variants
|
|
105
|
+
- `vector.setStyle`: brand colours
|
|
106
|
+
- `vector.createOutlines`, `vector.expandAppearance`, `vector.removeRedundantPoints`: prepare for delivery
|
|
107
|
+
- `vector.exportSvg`: the delivered file
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"prompt": "Centre the logo mark and the wordmark bar under it horizontally on the artboard, keeping the gap between them.",
|
|
3
|
+
"fixture": {
|
|
4
|
+
"editor": "vector",
|
|
5
|
+
"width": 120,
|
|
6
|
+
"height": 80,
|
|
7
|
+
"setup": [
|
|
8
|
+
{ "id": "vector.addShape", "params": { "kind": "ellipse", "x": 14, "y": 8, "width": 32, "height": 32, "name": "Mark", "fill": "#1d3557", "stroke": null } },
|
|
9
|
+
{ "id": "vector.addShape", "params": { "kind": "rect", "x": 30, "y": 52, "width": 64, "height": 12, "name": "Wordmark", "fill": "#1d3557", "stroke": null } }
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
"checks": [
|
|
13
|
+
{ "why": "both centred on the artboard", "tool": "run_command", "args": { "id": "vector.list" }, "expect": { "result": { "nodes": { "$length": 2, "$every": { "bounds": { "$expr": "Math.abs(v.x + v.width / 2 - 60) <= 0.5" } } } } } },
|
|
14
|
+
{ "why": "the vertical layout and gap are unchanged", "tool": "run_command", "args": { "id": "vector.list" }, "expect": { "result": { "nodes": [{ "name": "Mark", "bounds": { "y": 8, "height": 32 } }, { "name": "Wordmark", "bounds": { "y": 52, "height": 12 } }] } } }
|
|
15
|
+
],
|
|
16
|
+
"solution": [
|
|
17
|
+
{ "tool": "run_command", "args": { "id": "vector.transform", "params": { "ids": [{ "$read": "run_command", "args": { "id": "vector.list" }, "path": "result.nodes.0.id" }], "dx": 30 } } },
|
|
18
|
+
{ "tool": "run_command", "args": { "id": "vector.transform", "params": { "ids": [{ "$read": "run_command", "args": { "id": "vector.list" }, "path": "result.nodes.1.id" }], "dx": -2 } } }
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"prompt": "Cut the small circle out of the big one so the mark becomes a ring you can see through. This is for the final export file, so make it a single plain path.",
|
|
3
|
+
"fixture": {
|
|
4
|
+
"editor": "vector",
|
|
5
|
+
"width": 64,
|
|
6
|
+
"height": 64,
|
|
7
|
+
"setup": [
|
|
8
|
+
{ "id": "vector.addShape", "params": { "kind": "ellipse", "x": 4, "y": 4, "width": 56, "height": 56, "name": "Outer", "fill": "#e63946", "stroke": null } },
|
|
9
|
+
{ "id": "vector.addShape", "params": { "kind": "ellipse", "x": 20, "y": 20, "width": 24, "height": 24, "name": "Inner", "fill": "#ffffff", "stroke": null } }
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
"checks": [
|
|
13
|
+
{ "why": "one plain path, no groups", "tool": "run_command", "args": { "id": "vector.list" }, "expect": { "result": { "nodes": { "$length": 1, "$every": { "type": "path" } } } } },
|
|
14
|
+
{ "why": "a ring: the outer outline and the hole (two subpaths)", "tool": "run_command", "args": { "id": "vector.list" }, "expect": { "result": { "nodes": { "$every": { "bounds": { "x": 4, "y": 4, "width": 56, "height": 56 }, "d": { "$expr": "(v.match(/M/g) || []).length === 2" } } } } } },
|
|
15
|
+
{ "why": "the hole is see-through: no white is painted", "tool": "run_command", "args": { "id": "vector.list" }, "expect": { "result": { "nodes": { "$every": { "fill": "#e63946" } } } } }
|
|
16
|
+
],
|
|
17
|
+
"solution": [
|
|
18
|
+
{ "tool": "run_command", "args": { "id": "vector.list" } },
|
|
19
|
+
{ "tool": "run_command", "args": { "id": "vector.boolean", "params": { "operation": "subtract", "ids": { "$read": "run_command", "args": { "id": "vector.list" }, "path": "result.nodes.*.id" } } } }
|
|
20
|
+
]
|
|
21
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"prompt": "Merge the circle and the square into one silhouette for the logo mark, but keep both shapes editable so I can still nudge them.",
|
|
3
|
+
"fixture": {
|
|
4
|
+
"editor": "vector",
|
|
5
|
+
"width": 64,
|
|
6
|
+
"height": 64,
|
|
7
|
+
"setup": [
|
|
8
|
+
{ "id": "vector.addShape", "params": { "kind": "ellipse", "x": 8, "y": 8, "width": 32, "height": 32, "name": "Circle", "fill": "#1d3557", "stroke": null } },
|
|
9
|
+
{ "id": "vector.addShape", "params": { "kind": "rect", "x": 24, "y": 24, "width": 32, "height": 32, "name": "Square", "fill": "#1d3557", "stroke": null } }
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
"checks": [
|
|
13
|
+
{ "why": "one top-level object: a live union of the two", "tool": "run_command", "args": { "id": "vector.list" }, "expect": { "result": { "nodes": { "$expr": "v.filter((n) => n.depth === 0).length === 1", "$some": { "depth": 0, "liveBoolean": "union", "children": 2 } } } } },
|
|
14
|
+
{ "why": "covering both shapes", "tool": "run_command", "args": { "id": "vector.list" }, "expect": { "result": { "nodes": { "$some": { "depth": 0, "bounds": { "x": 8, "y": 8, "width": 48, "height": 48 } } } } } }
|
|
15
|
+
],
|
|
16
|
+
"solution": [
|
|
17
|
+
{ "tool": "run_command", "args": { "id": "vector.boolean", "params": { "operation": "union", "live": true, "ids": { "$read": "run_command", "args": { "id": "vector.list" }, "path": "result.nodes.*.id" } } } }
|
|
18
|
+
]
|
|
19
|
+
}
|