You can only access the color table in manual mode, run this script and change at least one color in the table, and then you can get both the counter and the color.
var d = new ActionDescriptor();
var r = new ActionReference();
r.putProperty( charIDToTypeID( "Clr " ), charIDToTypeID( "ClrT" ) );
d.putReference( charIDToTypeID( "null" ), r );
var ret = executeAction( charIDToTypeID( "setd" ), d, DialogModes.ALL );
if (ret.count)
{
var list = ret.getList(charIDToTypeID( "T " ));
alert ("Count:" + list.count);
var str = "";
for (var i = 0; i < list.count; i++)
{
var obj = list.getObjectValue(i);
for (var n = 0; n < obj.count; n++)
{
str += n + " " + obj.getDouble(stringIDToTypeID("red")) + " " + obj.getDouble(stringIDToTypeID("green")) + " " + obj.getDouble(stringIDToTypeID("blue")) + "\n"
}
}
}
else
{
alert("Nothing changed");
}
How to change, or have a better way? thank you!
How to get the color of the color table? I have one that is not perfect
-
- Posts: 3
- Joined: Tue Apr 21, 2020 4:21 am
Re: How to get the color of the color table? I have one that is not perfect
What do you mean by 'color table' in Photoshop and what to do 'display' it?
-
- Posts: 3
- Joined: Tue Apr 21, 2020 4:21 am
Re: How to get the color of the color table? I have one that is not perfect
Change document color model
ChangeMode.INDEXEDCOLOR
ChangeMode.INDEXEDCOLOR
Re: How to get the color of the color table? I have one that is not perfect
Probably you can't as stated in this topic: How can I get scripting access to color values in the indexed Color Table?
-
- Posts: 3
- Joined: Tue Apr 21, 2020 4:21 am
Re: How to get the color of the color table? I have one that is not perfect
I need to get it automatically without modifying the color table. What I published was not perfect