首页 > 其他 > 详细

PhotoShop 脚本学习05 设置PS前景色与背景色

时间:2020-02-03 15:34:55      阅读:74      评论:0      收藏:0      [点我收藏+]

confirm可弹出窗口,让用户选择是还是否

//弹出窗口询问用户是否更改?
var answer = confirm ("您需要设置前景色和背景色吗?");

if(answer) 
{
    //设置前景色 ,分别设置三个通道
    app.foregroundColor.rgb.red = Math.random()*255;
    app.foregroundColor.rgb.green = Math.random()*255;
    app.foregroundColor.rgb.blue =  Math.random()*255;
    //设置背景色 ,分别设置三个通道
    app.backgroundColor.rgb.red = Math.random()*255;
    app.backgroundColor.rgb.green = Math.random()*255;
    app.backgroundColor.rgb.blue = Math.random()*255;
}

设置为RGB值为0-255随机值,即合成随机色

PhotoShop 脚本学习05 设置PS前景色与背景色

原文:https://www.cnblogs.com/52vsto/p/12255778.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!