lyonlyke

HTML NAMED COLOR CHART

Oct 2nd, 2018
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.54 KB | None | 0 0
  1.  
  2. <!DOCTYPE html>
  3. <html lang="en-us">
  4. <head>
  5. <title>HTML COLOR CHART</title>
  6.  
  7. <style>
  8.  
  9.  
  10.  
  11.  
  12. body {height:100%:width:100%;margin:0;}
  13.  
  14.  
  15.  
  16. .banner {
  17. width:100%;
  18. height:50px;
  19. margin:0;
  20. }
  21.  
  22. .banner h2 {
  23.  
  24. margin:0;
  25. width:100%;
  26. height:50px;
  27. line-height:50px;
  28. text-align:center;
  29. background-color:#555;
  30. box-shadow:inset 0 0 30px #000;
  31. font-family:sans-serif;
  32. font-size:16px;
  33. font-weight:normal;
  34. letter-spacing:2px;
  35. word-spacing:5px;
  36. color:#EEE;
  37. text-shadow:2px 2px 3px #000;
  38. }
  39.  
  40.  
  41.  
  42. div {
  43. display:block;
  44. width:33.3%;
  45. line-height:80px;
  46. color:#000;
  47. margin:0;
  48. float:left;
  49. }
  50.  
  51. .headrs {height:40px; line-height:40px;background-color:lime;box-shadow:inset 0 0 15px #000;}
  52. .headrs h1 {color:#FFF; font-size:16px;}
  53.  
  54. div h1 {
  55. text-align:center;
  56. font-family:sans-serif;
  57. font-size:14px;
  58. font-weight:normal;
  59. margin:0;
  60. color:#000;
  61. }
  62.  
  63.  
  64.  
  65. </style>
  66.  
  67.  
  68. <script>
  69. var colors = new Array (
  70. 'Black:000000',
  71. 'Maroon:800000',
  72. 'DarkRed:8B0000',
  73. 'FireBrick:B22222',
  74. 'Tomato:FF6347',
  75. 'Red:FF0000',
  76. 'OrangeRed:FF4500',
  77. 'DarkOrange:FF8C00',
  78. 'Orange:FFA500',
  79. 'DarkGoldenRod:B8660B',
  80. 'GoldenRod:DAA520',
  81. 'LightGoldenRodYellow:FAFAD1',
  82. 'PaleGoldenRod:EEE8AA',
  83. 'Gold:FFD700',
  84. 'Yellow:FFFF00',
  85. 'LightYellow:FFFFE0',
  86. 'Olive:808000',
  87. 'DarkOliveGreen:556B2F',
  88. 'OliveDrab:6B8E23',
  89. 'YellowGreen:9ACD32',
  90. 'DarkGreen:006400',
  91. 'Green:008000',
  92. 'ForestGreen:228B22',
  93. 'LimeGreen:32CD32',
  94. 'Lime:00FF00',
  95. 'LawnGreen:7CFC00',
  96. 'Chartreuse:7FFF00',
  97. 'GreenYellow:ADFF2F',
  98. 'DarkSeaGreen:8FBC8F',
  99. 'SeaGreen:2E8B57',
  100. 'MediumSeaGreen:3CB371',
  101. 'MediumAquaMarine:66CDAA',
  102. 'Aquamarine:7FFFD4',
  103. 'LightSeaGreen:20B2AA',
  104. 'SpringGreen:00FF7F',
  105. 'MediumSpringGreen:00FA9A',
  106. 'LightGreen:90EE90',
  107. 'PaleGreen:98FB98',
  108. 'DarkCyan:008B8B',
  109. 'Teal:008080',
  110. 'Cyan:00FFFF',
  111. 'LightCyan:E0FFFF',
  112. 'DarkTurquoise:00CED1',
  113. 'Turquoise:40E0D0',
  114. 'MediumTurquoise:48D1CC',
  115. 'PaleTurquoise:AFEEEE',
  116. 'Aqua:00FFFF',
  117. 'DarkSlateBlue:483D8B',
  118. 'MediumSlateBlue:7B68EE',
  119. 'SkyBlue:87CEEB',
  120. 'SlateBlue:6A5ACD',
  121. 'MidnightBlue:191970',
  122. 'DarkBlue:00008B',
  123. 'Navy:00080',
  124. 'DodgerBlue:1E90FF',
  125. 'Blue:0000FF',
  126. 'RoyalBlue:4169E1',
  127. 'MediumBlue:0000CD',
  128. 'BlueViolet:8A2BE2',
  129. 'CadetBlue:5F9EA0',
  130. 'DeepSkyBlue:00BFFF',
  131. 'LightSkyBlue:87CEFA',
  132. 'CornflowerBlue:6495ED',
  133. 'SteelBlue:4682B4',
  134. 'LightSteelBlue:B0C4DE',
  135. 'LightBlue:ADD8E6',
  136. 'PowderBlue:B0E0E6',
  137. 'AliceBlue:F0F8FF',
  138. 'Indigo:4B0082',
  139. 'DarkOrchid:9932CC',
  140. 'DarkMagenta:8B008B',
  141. 'Purple:800080',
  142. 'MediumPurple:9370DB',
  143. 'RebeccaPurple:663399',
  144. 'DarkViolet:9400D3',
  145. 'Lavender:E6E6FA',
  146. 'LavenderBlush:FFF0F5',
  147. 'Magenta:FF00FF',
  148. 'MediumOrchid:BA55D3',
  149. 'MediumVioletRed:C71585',
  150. 'Fuchsia:FF00FF',
  151. 'Violet:EE82EE',
  152. 'DeepPink:FF1493',
  153. 'HotPink:FF69B4',
  154. 'Pink:FFC0CB',
  155. 'Plum:DDA0DD',
  156. 'Orchid:DA70D6',
  157. 'PaleVioletRed:DB7093',
  158. 'Thistle:D8BFD8',
  159. 'LightPink:FFB6C1',
  160. 'MistyRose:FFE4E1',
  161. 'Brown:A52A2A',
  162. 'Peru:CD853F',
  163. 'Sienna:A0522D',
  164. 'IndianRed:CD5C5C',
  165. 'Coral:FF7F50',
  166. 'LightCoral:F08080',
  167. 'DarkSalmon:E9967A',
  168. 'Salmon:FA8072',
  169. 'LightSalmon:FFA07A',
  170. 'Moccasin:FFE4B5',
  171. 'NavajoWhite:FFDEAD',
  172. 'AntiqueWhite:FAEBD7',
  173. 'Azure:F0FFFF',
  174. 'Beige:F5F5DC',
  175. 'Bisque:FFE4C4',
  176. 'BlanchedAlmond:FFEBCD',
  177. 'BurlyWood:DEB887',
  178. 'Chocolate:D2691E',
  179. 'Cornsilk:FFF8DC',
  180. 'DarkGray:A9A9A9',
  181. 'DarkGrey:A9A9A9',
  182. 'DarkKhaki:BDB76B',
  183. 'DarkSlateGray:2F4F4F',
  184. 'DarkSlateGrey:2F4F4F',
  185. 'DimGray:696969',
  186. 'DimGrey:696969',
  187. 'FloralWhite:FFFAF0',
  188. 'Gainsboro:DCDCDC',
  189. 'GhostWhite:F8F8FF',
  190. 'Gray:808080',
  191. 'Grey:808080',
  192. 'HoneyDew:F0FFF0',
  193. 'Ivory:FFFFF0',
  194. 'Khaki:F0E68C',
  195. 'LemonChiffon:FFFACD',
  196. 'LightGray:D3D3D3',
  197. 'LightGrey:D3D3D3',
  198. 'LightSlateGray:778899',
  199. 'LightSlateGrey:778899',
  200. 'Linen:FAF0E6',
  201. 'MintCreme:F5FFFA',
  202. 'OldLace:FDF5E6',
  203. 'PapayaWhip:FFEFD5',
  204. 'PeachPuff:FFDAB9',
  205. 'RosyBrown:BC8F8F',
  206. 'SaddleBrown:8B4513',
  207. 'SandyBrown:F4A460',
  208. 'SeaShell:FFF5EE',
  209. 'Silver:C0C0C0',
  210. 'SlateGray:708090',
  211. 'Snow:FFFAFA',
  212. 'Tan:D2B48C',
  213. 'Wheat:F5DEB3',
  214. 'White:FFFFFF',
  215. 'WhiteSmoke:F5F5F5'
  216.  
  217. );
  218.  
  219.  
  220. function makeHeaders(pos){
  221.  
  222. var title = '<div class="banner"><h2>HTML NAMED COLOR CHART<\/h2><\/h2>';
  223.  
  224. if (pos == 'top'){document.write(title);}
  225. var titles = new Array ('Color Pallet','Alphabetical','Reverse Order');
  226.  
  227. for(i = 0; i < titles.length;i++){
  228. document.write('<div class="headrs"><h1>'+titles[i]+'<\/h1><\/div>');
  229.  
  230. }
  231. if (pos == 'bottom'){document.write(title);}
  232. }
  233.  
  234.  
  235.  
  236. function drawColorChart(){
  237.  
  238. makeHeaders('top');
  239.  
  240. var sorted = colors.slice(0,146);
  241. var sorted = sorted.sort();
  242.  
  243. var reversed = colors.slice(0,146);
  244. var reversed = reversed.reverse();
  245.  
  246. for(i = 0; i < colors.length; i++){
  247.  
  248. var splitted = colors[i].split(':');
  249.  
  250. if(splitted[0] == "Black") {var textColor = 'white';}
  251. else {var textColor = "black";}
  252. document.write('<div style="background:\#'+splitted[1]+'"><h1 style="color:'+textColor+'">'+splitted[0]+' \&nbsp\; \#'+splitted[1]+'<\/h1><\/div>');
  253.  
  254. var splitted = sorted[i].split(':');
  255.  
  256. if(splitted[0] == "Black") {var textColor = 'white';}
  257. else {var textColor = "black";}
  258. document.write('<div style="background:\#'+splitted[1]+'"><h1 style="color:'+textColor+'">'+splitted[0]+' \&nbsp\; \#'+splitted[1]+'<\/h1><\/div>');
  259.  
  260. var splitted = reversed[i].split(':');
  261.  
  262. if(splitted[0] == "Black") {var textColor = 'white';}
  263. else {var textColor = "black";}
  264. document.write('<div style="background:\#'+splitted[1]+'"><h1 style="color:'+textColor+'">'+splitted[0]+' \&nbsp\; \#'+splitted[1]+'<\/h1><\/div>');
  265.  
  266.  
  267. }
  268. makeHeaders('bottom');
  269. }
  270.  
  271.  
  272. </script>
  273. </head>
  274. <body>
  275. <script>
  276. document.open();
  277. drawColorChart();
  278.  
  279. document.close();
  280.  
  281. </script>
  282.  
  283.  
  284.  
  285. </body>
  286. </html>
Advertisement
Add Comment
Please, Sign In to add comment