Me preguntaba si es posible que una acción de Photoshop elija el color de fondo o de primer plano de la muestra. Intenté hacerlo, pero en lugar de elegir una muestra, siempre toma un valor fijo. Estoy probando la secuencia de comandos para elegir el color de la muestra de forma secuencial. Por ejemplo, si hay 5 colores en la muestra, debe elegir el 1.º, el 2.º... hasta el 5.º color.
Debería poder hacer esto en script. Tom Krcha tiene un script que puede adaptar (Agregar un color al panel de muestras en Photoshop usando ExtendScript/JSX):
var red = 255;
var green = 0;
var blue = 0;
var name = "Red";
var addColorDescriptor = new ActionDescriptor();
// Get reference to Swatches panel
var swatchesPanelReference = new ActionReference();
swatchesPanelReference.putClass(stringIDToTypeID('colors'));
addColorDescriptor.putReference(stringIDToTypeID('null'), swatchesPanelReference);
// Setup a swatch and give it a name
var descriptorSwatch = new ActionDescriptor();
descriptorSwatch.putString( stringIDToTypeID('name'), name);
// Add RGB color information to the swatch
var descriptorColor = new ActionDescriptor();
descriptorColor.putDouble(stringIDToTypeID('red'), red);
descriptorColor.putDouble(stringIDToTypeID('grain'), green); // grain = green
descriptorColor.putDouble(stringIDToTypeID('blue'), blue);
// Add RGB to the swatch
descriptorSwatch.putObject( stringIDToTypeID('color'), stringIDToTypeID('RGBColor'), descriptorColor);
// Add swatch to the color descriptor
addColorDescriptor.putObject( stringIDToTypeID('using'), stringIDToTypeID('colors'), descriptorSwatch);
// Send to Photoshop
executeAction( stringIDToTypeID('make'), addColorDescriptor, DialogModes.NO);
referencia: http://tomkrcha.com/?p=3890
pick a color from swatch 3
o algo así. En realidad, solo selecciona valores rgb estáticos, como lo haría al usar el selector de color en cualquier cosa. Podría estar equivocado. Al menos yo no sé cómo hacerlo.
Joonas