Graphic Style
The graphicstyle method creates or updates a named Illustrator Graphic Style. The style can be copied from tagged artwork or assembled from the same strokes, fills, transparency settings, and live effects used by the appearance method.
Use the Graphic Style editor in Tools → Methods to load selected artwork, build a custom appearance, and add the resulting method block to Builder. See the Graphic Style editor guide for the editor workflow.
Graphic Style and Appearance
Graphic Style uses the Appearance property system, but its result is different:
appearancechanges artwork or a layer.graphicstylecreates or changes a reusable, named entry in Illustrator's Graphic Styles panel.
Every Graphic Style needs a name. Use styleName; the aliases style and name are also accepted.
There are two ways to define the style:
- Put a tag search in the method block's Darty header. The appearance of the first matching object becomes the source style.
- Leave the source tag blank and describe the style with fill, stroke, transparency, and effect properties.
The Tools editor also offers Load from Selection, which reads the selected Illustrator artwork into the editor. Adding that configuration to Builder writes the resulting appearance properties into the sheet; the selection itself is not required when the sheet runs.
Creating, Merging, and Replacing
If styleName does not exist, Darty creates it. If the name already exists, replace determines how the new definition is handled.
| Value | Result |
|---|---|
replace: false or omitted | Merge the supplied appearance into the existing named style. |
replace: true | Redefine the named style with the supplied appearance. |
When the style is copied from tagged artwork, the same merge-or-replace rule applies to the copied appearance.
Root Properties
Graphic Style accepts the root Appearance properties as well as indexed paints and effects.
| Property | Description |
|---|---|
styleName | Required name of the Graphic Style. Aliases: style, name. |
tagSearch | Source artwork whose appearance should be copied. In Builder this is normally written in the method block's Darty header. |
replace | Replace an existing named style instead of merging into it. Valid Values: true, false. |
visible | Sets the visibility of the custom appearance. Valid Values: true, false. |
blendMode | Sets the style's root blend mode. See General Appearance Properties. |
opacity | Root opacity percentage. |
opacityEnabled | Enables or disables root opacity. Valid Values: true, false. |
isolateBlending | Controls isolated blending. Valid Values: true, false. |
knockout | Controls knockout behavior. Valid Values: true, false. |
opacityDefineKnockout | Uses opacity to define the knockout shape. Valid Values: true, false. |
contentsPosition | Controls where object contents sit in the appearance stack. |
uiMethod | Uses Illustrator's UI-compatible appearance application path. Valid Values: true, false. |
applyEffectsToGroupMembers | Applies effects to members of a group where supported. Valid Values: true, false. |
skip | Skips the method for this data row. See * and Skip. Valid Values: true, false. |
layerName and layerNumber are inherited Appearance properties and can be authored by the shared Tools editor. For Graphic Style creation, use a source tag or a custom appearance definition as the dependable source of the named style.
Paint Fields
Use fill[n] and stroke[n] to address fills and strokes independently. Index 1 is the first matching paint field from the top of Illustrator's Appearance panel.
Use pf[n] when the exact sequence of fills and strokes matters. A generic paint field also needs pf[n]isFill so Darty knows whether it is a fill or stroke.
Examples:
fill[1]colorsets the first fill's color.stroke[2]widthsets the second stroke's width.pf[3]isFill: falsemakes the third paint field a stroke.stroke[1]effect[1]nameadds an effect to the first stroke.
See Stroke, Fill, and Effect Indexes for indexing details.
Paint Field Modes
| Mode | Description |
|---|---|
add | Inserts a new paint field at the requested index. |
addEdit | Edits an existing paint field or adds it when missing. Existing unspecified properties are preserved. This is the default. |
addEditRE | Like addEdit, but removes existing effects from the paint field before applying the supplied effects. |
edit | Edits an existing paint field but does not add a missing one. |
editRE | Like edit, but removes existing effects from the targeted paint field. |
remove | Removes the targeted paint field. |
replace | Replaces the targeted paint field, including its effects, with the supplied definition. |
These values are used with properties such as fill[1]mode or stroke[1]mode. They are separate from the root replace property that controls merging or replacing the named Graphic Style.
Fill and Stroke Properties
Both fills and strokes support visibility, color, blend mode, opacity, overprint, knockout, isolated blending, and nested effects. Fills additionally support the even-odd fill rule. Strokes add the following controls.
| Property family | Example | Values or purpose |
|---|---|---|
| Width | stroke[1]width | A number or unit value such as 2pt. |
| Alignment | stroke[1]strokeAlign | center, inside, outside. See Known Issues. |
| Cap | stroke[1]strokeCap | butt, round, projecting. |
| Corner | stroke[1]strokeCorner | miter, round, bevel. |
| Miter limit | stroke[1]miterLimit | Numeric miter limit. |
| Dashes | stroke[1]dashValues | A list such as 10, 5. |
| Dash alignment | stroke[1]dashAlignment | adjust or preserve. |
| Arrowheads | stroke[1]startArrow and stroke[1]endArrow | Start and end arrowhead definitions, including scale and alignment properties. |
For color syntax, swatches, and color spaces, see Appearance Colors. For basic fill and stroke properties, see Appearance - General.
Effects
Effects can be placed before the paint stack, on a particular fill or stroke, or after the paint stack:
preEffect[1]...targets a pre-paint effect.fill[1]effect[1]...targets an effect attached to the first fill.stroke[1]effect[1]...targets an effect attached to the first stroke.postEffect[1]...targets a post-paint effect.
The editor supports Illustrator effects including Blur, Convert to Shape, Crop Marks, Drop Shadow, Feather, glows, Offset Path, outlines, Pathfinder, Pucker & Bloat, Rasterize, Roughen, Round Corners, Scribble, Transform, Tweak, Twist, Warp, and Zig Zag. Each effect has its own properties. See Appearance Effects.
Sample Spreadsheets
Copy a Style from Tagged Artwork
This creates Packaging Highlight from the appearance of the first object tagged style-source. If the style already exists, its existing appearance is replaced.
| style-source | |
| graphicstyle | |
| styleName | replace |
| Style name | Replace existing style |
| Packaging Highlight | true |
Build a Style from Properties
This creates a named style without depending on source artwork.
| * | ||||
| graphicstyle | ||||
| styleName | fill[1]color | stroke[1]color | stroke[1]width | postEffect[1]name |
| Style name | Fill | Stroke | Width | Effect |
| Product Badge | cmyk 0 15 100 0 | cmyk 0 0 0 100 | 2pt | dropShadow |
Merge into an Existing Style
With replace omitted or false, only the supplied definition is merged into the existing named style.
| * | |||
| graphicstyle | |||
| styleName | replace | fill[1]mode | fill[1]color |
| Existing style | Merge | Paint operation | New fill color |
| Product Badge | false | addEdit | rgb 40 120 210 |
Known Issues
Creating a named Graphic Style can currently store an Inside or Outside stroke alignment as Center. Editing or applying an appearance to existing artwork can behave correctly, so this limitation may only appear when the named style is created or redefined.
When stroke alignment is critical, create the style, inspect it in Illustrator's Appearance panel, and correct the alignment after creation if necessary. Until this creation-path limitation is fixed, the appearance method is the safer route for applying Inside or Outside alignment directly to existing artwork.