In extendscript it is possible to return a descriptor and get values entered by the user. For this expendscript example, there is already a solid color layer in the document. This will open up the dialog for the user to change the colors and then return the RGB values the user selected in the dialog.
Is there a way to do this in UXP?
var redCurrent=128;
var greenCurrent=128;
var blueCurrent=128;
var desc = changeSolidColor(redCurrent,greenCurrent,blueCurrent);
var ToDesc = desc.getObjectValue(charIDToTypeID( "T " ));
var list = ToDesc.getList(charIDToTypeID( "Clr " ));
var levelDesc = list.getObjectValue(0);
var redNew=Math.round(levelDesc.getDouble(charIDToTypeID( "Rd " )));
var greenNew=Math.round(levelDesc.getDouble(charIDToTypeID( "Grn " )));
var blueNew=Math.round(levelDesc.getDouble(charIDToTypeID( "Bl " )));
function changeSolidColor(red,green,blue){
var id30 = charIDToTypeID( "setd" );
var desc7 = new ActionDescriptor();
var id31 = charIDToTypeID( "null" );
var ref2 = new ActionReference();
var id32 = stringIDToTypeID( "contentLayer" );
var id33 = charIDToTypeID( "Ordn" );
var id34 = charIDToTypeID( "Trgt" );
ref2.putEnumerated( id32, id33, id34 );
desc7.putReference( id31, ref2 );
var id35 = charIDToTypeID( "T " );
var desc8 = new ActionDescriptor();
var id36 = charIDToTypeID( "Clr " );
var desc9 = new ActionDescriptor();
var id37 = charIDToTypeID( "Rd " );
desc9.putDouble( id37, red );
var id38 = charIDToTypeID( "Grn " );
desc9.putDouble( id38, green );
var id39 = charIDToTypeID( "Bl " );
desc9.putDouble( id39, blue );
var id40 = charIDToTypeID( "RGBC" );
desc8.putObject( id36, id40, desc9 );
var id41 = stringIDToTypeID( "solidColorLayer" );
desc7.putObject( id35, id41, desc8 );
return userRGB = executeAction( id30, desc7, DialogModes.ALL );
}