• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

i want to create new swatches color by (javascript)

Explorer ,
Aug 19, 2016 Aug 19, 2016

Copy link to clipboard

Copied

i want to create new swatches color from foreground color by (javascript)  .. and thank you

TOPICS
Actions and scripting

Views

1.6K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Explorer ,
Aug 19, 2016 Aug 19, 2016

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);

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 22, 2016 Aug 22, 2016

Copy link to clipboard

Copied

var red = app.foregroundColor.rgb.red;

var blue = app.foregroundColor.rgb.blue;

var green = app.foregroundColor.rgb.green;

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 22, 2016 Aug 22, 2016

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 22, 2016 Aug 22, 2016

Copy link to clipboard

Copied

ss.jpg

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 22, 2016 Aug 22, 2016

Copy link to clipboard

Copied

Extension manager is deprecated.

See:

- Adobe Exchange

- How do I install zxp files in CC 2015?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 22, 2016 Aug 22, 2016

Copy link to clipboard

Copied

thanks jarda but i want to convert(export) my panel to zxp not installing

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 22, 2016 Aug 22, 2016

Copy link to clipboard

Copied

It is not so easy... Improve Your Workflow By Creating A Photoshop Panel

There are some changes between versions.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 22, 2016 Aug 22, 2016

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 22, 2016 Aug 22, 2016

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines