Skip to content

Instantly share code, notes, and snippets.

@Lokno
Created June 8, 2020 15:09
Show Gist options
  • Select an option

  • Save Lokno/5aa37d966e5a6022be15cd6d27bcecfb to your computer and use it in GitHub Desktop.

Select an option

Save Lokno/5aa37d966e5a6022be15cd6d27bcecfb to your computer and use it in GitHub Desktop.
Sets the gray scale color of each text item in a group of a given name to a smooth gradient
var layerSetText = app.activeDocument.layerSets.getByName("GROUPNAME")
for (var i=0; i<layerSetText.artLayers.length; i++) {
var col = new SolidColor();
var grayCol = new GrayColor();
grayCol.gray = i*100.0/(layerSetText.artLayers.length-1);
col.gray = grayCol;
layerSetText.artLayers[i].textItem.color = col;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment