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

JavaScript method to obtain WEB safe color list_javascript skills

WBOY
Release: 2016-05-16 15:50:25
Original
1325 people have browsed it

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 />');
   }
  }
 }
}

Copy after login

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template