select color




Select Color


function _CloseOnEsc() {
if (event.keyCode == 27) { window.close(); return; }
}

function Init() { // run on page load
document.body.onkeypress = _CloseOnEsc;

color = window.dialogArguments;
color = ValidateColor(color) || '000000';
View(color); // set default color
}

function View(color) { // preview color
document.all.ColorPreview.style.backgroundColor = '#' + color;
document.all.ColorHex.value = '#' + color;
}

function Set(string) { // select color
color = ValidateColor(string);
if (color == null) { alert("Invalid color code: " + string); } // invalid color
else { // valid color
View(color); // show selected color
window.returnValue = color; // set return value
window.close(); // close dialog
}
}

function ValidateColor(string) { // return valid color code
string = string || '';
string = string + "";
string = string.toUpperCase();
chars = '0123456789ABCDEF';
out = '';

for (i=0; i

Wyszukiwarka

Podobne podstrony:
select color
select color
select color
select color
select color
select color
color selector (4)
Functional Origins of Religious Concepts Ontological and Strategic Selection in Evolved Minds
function ncurses can change color
border top color
function socket select
selectnpc
grafika inzynierska wyklad 3 color
Coherence Selection Phase Cycling and Gradient Pulses
selectors

więcej podobnych podstron