Home > Web Front-end > JS Tutorial > body text

JavaScript取得WEB安全颜色列表的方法_javascript技巧

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

本文实例讲述了JavaScript取得WEB安全颜色列表的方法。分享给大家供大家参考。具体如下:

web安全颜色指的是 护眼色, 能够让访问者的眼睛舒服的颜色

//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 + '
'); } } } }
Copy after login

希望本文所述对大家的javascript程序设计有所帮助。

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 [email protected]
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!