# Graphic Style ⏳
# Method Description
blah!
# Method Properties and Screenshot
See Basic Stroke and Fill Properties.
Mode | Description |
---|---|
add | Adds / inserts a new paint field at the given index |
addEdit | Edits an existing paint field, existing properties will be kept besides those explicitly changed. If the paint field does not exist it will be added. This is the default mode. |
addEditRE | Edits an existing paint field, existing properties will be kept besides those explicitly changed. Effects however, will be removed from the paint field. If the paint field does not exist it will be added. |
edit | Edits an existing paint field, existing properties will be kept besides those explicitly changed. If the paint field does not exist it will NOT be added. |
editRE | Edits an existing paint field, existing properties will be kept besides those explicitly changed. Effects however, will be removed from the paint field. If the paint field does not exist it will NOT be added. |
remove | Removes the targeted paint field |
replace | Replaces all existing properties including effect from the targeted paint field with newly provided properties |
# Sample Spreadsheet
Compare each row in the spreadsheet below with its associated screenshot above.
star | ||
appearance | ||
stroke[1]mode | stroke[1]color | stroke[1]width: 2pt |
See associated graphic 👆 | ||
add | #red | 2pt |
replace | #cyan | 2pt |
addEdit | #purple | 2pt |
addEditRE | #green | 2pt |
editRE | #orange | 2pt |
edit | #lime | 2pt |
remove |
# createGraphicStyle
Create or change a named graphic style that will appear in the Graphic Styles palette.
{"tagSearch": "abc", "styleName": "Test"}
Copy a graphic style of an object tagged abc
and create a style named Test
in the Graphic Styles palette.
{"tagSearch": "abc", "styleName": "Bevel Soft", "replace":true}
Same as previous but replace an existing named style Bevel Soft
.
{"tagSearch": "abc", "styleName": "Bevel Soft"}
Same as previous but merge new style with the existing style instead of replacing it.
{"styleName": "Test", "replace":true, "newStyle":{"paintFields":[{"color":{"channel_1":0,"channel_2":0,"channel_3":0,"channel_4":0,"colorSpace":"None"},"isFill":false},{"color":{"channel_1":0,"channel_2":100,"channel_3":100,"channel_4":0,"colorSpace":"CMYK"},"isFill":true,"pfEffects":[{"FillColor sclr":{"channel_1":0,"channel_2":100,"channel_3":100,"channel_4":0,"colorSpace":"CMYK"},"name":"Adobe Drop Shadow","parameters":{"B pair":"1","B usePSLBlur":"1","I Adobe Effect Expand Before Version":"16","I blnd":"1","I csrc":"0","R blur":"5","R dark":"100","R horz":"7","R opac":"0.75","R vert":"7"}}]}]}}
Create a new style named Test
in the Graphic Styles palette.
{"styleName": "Bevel Soft", "replace":true, "newStyle":{"paintFields":[{"color":{"channel_1":0,"channel_2":0,"channel_3":0,"channel_4":0,"colorSpace":"None"},"isFill":false},{"color":{"channel_1":0,"channel_2":100,"channel_3":100,"channel_4":0,"colorSpace":"CMYK"},"isFill":true,"pfEffects":[{"FillColor sclr":{"channel_1":0,"channel_2":100,"channel_3":100,"channel_4":0,"colorSpace":"CMYK"},"name":"Adobe Drop Shadow","parameters":{"B pair":"1","B usePSLBlur":"1","I Adobe Effect Expand Before Version":"16","I blnd":"1","I csrc":"0","R blur":"5","R dark":"100","R horz":"7","R opac":"0.75","R vert":"7"}}]}]}}
Same as previous but replace an existing named style Bevel Soft
.
{"styleName": "Bevel Soft", "newStyle":{"paintFields":[{"color":{"channel_1":0,"channel_2":0,"channel_3":0,"channel_4":0,"colorSpace":"None"},"isFill":false},{"color":{"channel_1":0,"channel_2":100,"channel_3":100,"channel_4":0,"colorSpace":"CMYK"},"isFill":true,"pfEffects":[{"FillColor sclr":{"channel_1":0,"channel_2":100,"channel_3":100,"channel_4":0,"colorSpace":"CMYK"},"name":"Adobe Drop Shadow","parameters":{"B pair":"1","B usePSLBlur":"1","I Adobe Effect Expand Before Version":"16","I blnd":"1","I csrc":"0","R blur":"5","R dark":"100","R horz":"7","R opac":"0.75","R vert":"7"}}]}]}}
Same as previous but merge new style with the existing style instead of replacing it.
See the makeSwatch
for more details about setting creating/editing colors.
graphicstyle: {},
Looks not done!