Copy link to clipboard
Copied
i want to create new swatches color from foreground color by (javascript) .. and thank you
Copy link to clipboard
Copied
i want to make swatch based on foreground color
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); |
Copy link to clipboard
Copied
var red = app.foregroundColor.rgb.red;
var blue = app.foregroundColor.rgb.blue;
var green = app.foregroundColor.rgb.green;
Copy link to clipboard
Copied
you're a great man ..very thanx jarda
..but i have other problem if you can help me
.. i want to export photoshop cc panel to zxp it works when exporting to CS6 .but not working with photoshop cc panel ,And I tried to work on the other panel but without advantage, I've tried both Java 7 and 6
i want to export it to zxp with photoshop cc 2014 or 2015 .and thanx jarda
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
thanks jarda but i want to convert(export) my panel to zxp not installing
Copy link to clipboard
Copied
It is not so easy... Improve Your Workflow By Creating A Photoshop Panel
There are some changes between versions.
Copy link to clipboard
Copied
I'm sorry for asking too many questions ,but i want to make color table in a new swatch color or saving color table ..and thaks alot jarda
Copy link to clipboard
Copied
you can do script and assign shortcut for it... this is most simple. If you want custom panel, then it is more complicated (see my links) and it can't be done via Configurator for PS CC2015