最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
flash 如何获取当前鼠标位置的RGB值
时间:2022-07-02 17:00:14 编辑:袖梨 来源:一聚教程网
myphoto = new .display.BitmapData(Stage.width, Stage.height);
myphoto .draw(_root);
mc1.onRelease = function() {
var onColor:String = myphoto .getPixel(_root._xmouse, _root._ymouse).toString(16).toUpperCase();
trace(onColor)
};
var selectedColor;
function CreatecolorTable(colorSelector, onClickOK){
colorSelector.style.;
colorSelector.style.cursor="hand";
var oTable=document.createElement("table");
oTable.style.cursor="hand";
with(oTable){border=0;cellspacing=0;cellpadding=0;}
colorSelector.appendChild(oTable);
var colorRes=document.createElement("div");
colorRes.id="colorRes";
var btnOK=document.createElement("button");
btnOK.style.;
btnOK.innerText="OK";
btnOK.onclick=function(){
resColor=selectedColor;
colorSelector.selectedColor=selectedColor;
colorSelector.blur();
colorSelector.style.display="none";
};
colorRes.appendChild(btnOK);
var btnCancel=document.createElement("button");
btnCancel.style.;
btnCancel.innerText="Cancel";
btnCancel.onclick=function(){
resColor=null;
colorSelector.selectedColor=selectedColor;
colorSelector.blur();
colorSelector.style.display="none";
};
colorRes.appendChild(btnCancel);
colorSelector.appendChild(colorRes);
// Create the base colors array.
var aColors = ['00','33','66','99','cc','ff'] ;
// This function combines two ranges of three values from the color array into a row.
function AppendColorRow(rangeA, rangeB){
for(var i=rangeA;i
for(var j=rangeB;j
}
}
}
}
// This function create a single color cell in the color table.
function AppendColorCell(targetRow, color){
var oCell=targetRow.insertCell(-1);
oCell.style.;oCell.style.;
oCell.bgColor=color;
oCell.onfocus=function(){
this.style.;
this.style.;
this.style.border="1px solid #ff0000";
}
oCell.onblur=function(){
this.style.border="0px";
this.style.;
this.style.;
}
oCell.onclick=function(){
selectedColor=this.bgColor;
}
}
AppendColorRow(0, 0);
AppendColorRow(3, 0);
AppendColorRow(0, 3);
AppendColorRow(3, 3);
// Create the last row.
var oRow=oTable.insertRow(-1);
// Create the gray scale colors cells.
for(var n=0;n
var cc=n.toString(16);
cc=(cc.length==2?cc:"0"+cc);
AppendColorCell(oRow, '#'+cc+cc+cc);
}
}
function colorMinus(color){
var r=(255-parseInt("0x"+color.substr(1,2))).toString(16);
r=(r.length==1?"0"+r:r);
var g=(255-parseInt("0x"+color.substr(3,2))).toString(16);
g=(g.length==1?"0"+g:g);
var b=(255-parseInt("0x"+color.substr(5,2))).toString(16);
b=(b.length==1?"0"+b:b);
return "#"+r+g+b;
}
相关文章
- 樱花动漫下载最新版本-樱花动漫官方正版安装入口与使用教程 02-15
- 淘宝连续打卡免费领奖入口在哪-淘宝连续打卡免费领奖为啥没有 02-15
- 夸克浏览器2026官网登录入口-夸克浏览器在线打开官网 02-15
- 知乎网页版直达-知乎官网链接速递 02-15
- 二重螺旋充值入口在哪-二重螺旋官网月石晶胚充值通道 02-15
- 长佩文学城官网入口-长佩文学城登录入口 02-15