-
Notifications
You must be signed in to change notification settings - Fork 3
/
cores.php
executable file
·124 lines (115 loc) · 4.32 KB
/
cores.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<?
/*
* E-cidade Software Publico para Gestao Municipal
* Copyright (C) 2009 DBselller Servicos de Informatica
* www.dbseller.com.br
*
* Este programa e software livre; voce pode redistribui-lo e/ou
* modifica-lo sob os termos da Licenca Publica Geral GNU, conforme
* publicada pela Free Software Foundation; tanto a versao 2 da
* Licenca como (a seu criterio) qualquer versao mais nova.
*
* Este programa e distribuido na expectativa de ser util, mas SEM
* QUALQUER GARANTIA; sem mesmo a garantia implicita de
* COMERCIALIZACAO ou de ADEQUACAO A QUALQUER PROPOSITO EM
* PARTICULAR. Consulte a Licenca Publica Geral GNU para obter mais
* detalhes.
*
* Voce deve ter recebido uma copia da Licenca Publica Geral GNU
* junto com este programa; se nao, escreva para a Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307, USA.
*
* Copia da licenca no diretorio licenca/licenca_en.txt
* licenca/licenca_pt.txt
*/
?>
<html>
<title></title>
<body>
<table width="589" border="0" cellspacing="0" cellpadding="0" align="center">
<tr align="center" valign="middle">
<td height="22">
<table width="25" border="4" cellspacing="0" cellpadding="0">
<tr>
<td>
<script language="JavaScript">
var hex = new Array(6)
// assign non-dithered descriptors
hex[0] = "FF"
hex[1] = "CC"
hex[2] = "99"
hex[3] = "66"
hex[4] = "33"
hex[5] = "00"
// accept triplet string and display as background color
function display(triplet) {
// set color as background color
document.bgColor = '#' + triplet
// display the color hexadecimal triplet
// alert('A cor deste background é #' + triplet)
}
// draw a single table cell based on all descriptors
function drawCell(red, green, blue) {
// open cell with specified hexadecimal triplet background color
document.write('<TD BGCOLOR="#' + red + green + blue + '">')
// open a hypertext link with javascript: scheme to call display function
document.write('<A HREF="javascript:display(\'' + (red + green + blue) + '\')">')
// print transparent image (use any height and width)
document.write('<IMG SRC="place.gif" BORDER=0 HEIGHT=12 WIDTH=12>')
// close link tag
document.write('</A>')
// close table cell
document.write('</TD>')
}
// draw table row based on red and blue descriptors
function drawRow(red, blue) {
// open table row
document.write('<TR>')
// loop through all non-dithered color descripters as green hex
for (var i = 0; i < 6; ++i) {
drawCell(red, hex[i], blue)
}
// close current table row
document.write('</TR>')
}
// draw table for one of six color cube panels
function drawTable(blue) {
// open table (one of six cube panels)
document.write('<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0>')
// loop through all non-dithered color descripters as red hex
for (var i = 0; i < 6; ++i) {
drawRow(hex[i], blue)
}
// close current table
document.write('</TABLE>')
}
// draw all cube panels inside table cells
function drawCube() {
// open table
document.write('<TABLE CELLPADDING=5 CELLSPACING=0 BORDER=1><TR>')
// loop through all non-dithered color descripters as blue hex
for (var i = 0; i < 6; ++i) {
// open table cell with white background color
document.write('<TD BGCOLOR="#FFFFFF">')
// call function to create cube panel with hex[i] blue hex
drawTable(hex[i])
// close current table cell
document.write('</TD>')
}
// close table row and table
document.write('</TR></TABLE>')
}
// call function to begin execution
drawCube()
// -->
</script>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>