用于查找文档中所有颜色的Illustrator脚本 [英] Illustrator script to find all colors in document
本文介绍了用于查找文档中所有颜色的Illustrator脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在寻找一个脚本,它会通过颜色编号(rgb或cmyk)为我提供Adobe Illustrator文档中所有颜色的列表。我没有代码,也不知道如何做到这一点,或者如果你能做到的话。任何人都可以给我任何信息吗?
I am looking for a script that will give me a list of all the colors in an Adobe Illustrator document by there color numbers (rgb or cmyk). I have no code and have no idea how to do this, or if you even can. Can anyone please give me any information?
推荐答案
这将遍历活动文档中的所有形状,并获取帖子提醒他们的RGB填充颜色:
This will loop through all the shapes in the active document and gets posts an alert with their RGB fill colours:
with (app.activeDocument) {
if (pathItems.length > 0)
{
alert(pathItems.length);
for (var g = 0 ; g < pathItems.length; g++)
{
if (pathItems[g].filled == true)
{
if (pathItems[g].fillColor.red > 200 == true && pathItems[g].fillColor.red < 210 == true && pathItems[g].fillColor.green > 200 == true && pathItems[g].fillColor.green < 210 == true && pathItems[g].fillColor.blue > 200 == true && pathItems[g].fillColor.blue < 210 == true)
{
alert('R' + pathItems[g].fillColor.red + ' G' + pathItems[g].fillColor.green + ' B' + pathItems[g].fillColor.blue);
}
}
}
}
}
注意:您的文档必须处于RGB颜色模式才能使用
Note: You document must be in RGB colour mode for this to work
长如果
行awers你的其他问题
这篇关于用于查找文档中所有颜色的Illustrator脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文