52vsto

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随机值,即合成随机色

分类:

技术点:

相关文章:

  • 2021-10-06
  • 2021-12-19
  • 2021-10-12
  • 2021-10-31
  • 2021-06-28
  • 2021-12-01
  • 2021-09-24
  • 2021-11-04
猜你喜欢
  • 2021-06-25
  • 2021-09-16
  • 2021-06-25
  • 2021-09-16
  • 2021-11-01
  • 2021-12-01
  • 2021-06-24
相关资源
相似解决方案