Home  >  Article  >  Web Front-end  >  JavaScript method to obtain WEB safe color list_javascript skills

JavaScript method to obtain WEB safe color list_javascript skills

WBOY
WBOYOriginal
2016-05-16 15:50:251303browse

The example in this article describes how to obtain the WEB safe color list using JavaScript. Share it with everyone for your reference. The details are as follows:

Web safety colors refer to eye protection colors, colors that make visitors’ eyes comfortable

//JavaScript取得216种WEB安全色值
var n = 0;
var hex = new Array('FF', 'CC', '99', '66', '33', '00');
function colorPanel(){
 for (var i = 0; i < 6; i++) {
  for (var j = 0; j < 6; j++) {
   for (var k = 0; k < 6; k++) {
    n++;
    var color = hex[j] + hex[k] + hex[i];
    document.write(color + '<br />');
   }
  }
 }
}

I hope this article will be helpful to everyone’s JavaScript programming design.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn