Copy link to clipboard
Copied
How can you make a selection based on color
For example, all pixels white?
Something like this:
app.activeDocument.Selection.select(0,White);
Thanks!
Use the AM code ScriptingListener.plugin creates when you perform the corresponding operation (in this case this could for example be Color Range).
Copy link to clipboard
Copied
Use the AM code ScriptingListener.plugin creates when you perform the corresponding operation (in this case this could for example be Color Range).
Copy link to clipboard
Copied
Bonjour
You can use the function selectColorRange() - xbytor in xtools ( xtools ) - stdlib.js
"
//RechercheBlanc.jsx
//RechercheBlanc.jsx
//Recherche une couleur
var chercheCouleur = new SolidColor();
chercheCouleur.rgb.red=255;
chercheCouleur.rgb.green=255;
chercheCouleur.rgb.blue=255;
selectColorRange(chercheCouleur);
function selectColorRange(scObj)
{
var desc = new ActionDescriptor();
desc.putInteger( charIDToTypeID( "Fzns" ), 0 );
var cDesc = new ActionDescriptor();
cDesc.putDouble( charIDToTypeID( "Rd " ), scObj.rgb.red);
cDesc.putDouble( charIDToTypeID( "Grn " ), scObj.rgb.green);
cDesc.putDouble( charIDToTypeID( "Bl " ), scObj.rgb.blue );
desc.putObject( charIDToTypeID( "Mnm " ), charIDToTypeID( "RGBC" ), cDesc );
desc.putObject( charIDToTypeID( "Mxm " ), charIDToTypeID( "RGBC" ), cDesc );
executeAction( charIDToTypeID( "ClrR" ), desc, DialogModes.NO );
}
"
Copy link to clipboard
Copied
Thank you
It really select the white, but I do not understand anything, what it ActionDescriptor, PutDouble?
And whether it is possible to increase the range of selection, have not only one color?
Copy link to clipboard
Copied
1/
you gotta ask .... xbytor
2/
By using methodes store() load() - SelectionType.INTERSECT // EXTEND REPLACE ???
Copy link to clipboard
Copied
Thank you very much
Find more inspiration, events, and resources on the new Adobe Community
Explore Now