⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 selcolor.asp

📁 企业管理系统erp商业源码,功能强大
💻 ASP
字号:
<%''Option Explicit%>
<HTML>
<HEAD>
<TITLE>颜色选择</TITLE>

<STYLE TYPE="text/css">
BODY   {margin-left:10; font-family:Verdana; font-size:92%; background:menu}
BUTTON {width:5em}
P      {text-align:center}
TABLE  {cursor:hand}
INPUT  {font-family:Verdana; font-size: 92%}
</STYLE>

<SCRIPT LANGUAGE=JavaScript FOR=ColorTable EVENT=onclick>
<!--
SelColor.value = event.srcElement.title;
// -->
</SCRIPT>

<SCRIPT LANGUAGE=JavaScript FOR=ColorTable EVENT=onmouseover>
<!--
RGB.innerText = event.srcElement.bgColor;
// -->
</SCRIPT>

<SCRIPT LANGUAGE=JavaScript FOR=ColorTable EVENT=onmouseout>
<!--
RGB.innerText = " ";
// -->
</SCRIPT>

<SCRIPT LANGUAGE=JavaScript FOR=Ok EVENT=onclick>
<!--
window.returnValue = SelColor.value;
window.close();
// -->
</SCRIPT>

</HEAD>

<BODY onload="SelColor.focus()">
<br>
<%
Dim arrColors   ' Array of usable colors
Dim iMinColor   ' LBound of the array
Dim iMaxColor   ' UBound of the array
Dim iR, iG, iB  ' Index vars for looping of each color
Dim strColor    ' Temp var for building color string in loop

' Assign acceptable color components in hex.
' This is the 216 color web-safe palette.
arrColors = Array("00", "33", "66", "99", "CC", "FF")

' Note that the same array is used for all the colors since
' it's really just a mechanish to hold the hex values.

' You do this to save the processing time that would o/w
' result from doing this computation on each pass of the loop.
iMinColor = LBound(arrColors)
iMaxColor = UBound(arrColors)

' Table the colors for neat display
%>
<TABLE ID=ColorTable
 BORDER=1
 BORDERCOLOR=SILVER
 BORDERCOLORLIGHT=WHITE
 BORDERCOLORDARK=BLACK
 CELLSPACING=0
 CELLPADDING=0>
<%
' Loop through reds
For iR = iMinColor To iMaxColor
    ' Put in a row break so we can see the whole thing on one page
    Response.Write "<tr>" & vbCrLf
    ' Loop through greens
    For iG = iMinColor To iMaxColor
        ' Loop through blues
        For iB = iMinColor To iMaxColor
            ' calculate the color and show it
            strColor = "#" & arrColors(iR) & arrColors(iG) & arrColors(iB)
            Response.Write "<td bgcolor=""" & strColor & """ title=""" & strColor & """>" _
                & "&nbsp;&nbsp;</td>" & vbCrLf
        Next 'iB
    Next 'iG
    Response.Write "</tr>" & vbCrLf
Next 'iR
%>
</table>
<P>
<LABEL FOR=SelColor>颜色值:</LABEL>
<INPUT TYPE=TEXT SIZE=20 ID=SelColor>
<BR>
<SPAN ID=RGB>&nbsp;</SPAN>

<P>
<BUTTON ID=Ok TYPE=SUBMIT>确定</BUTTON>&nbsp; 
<BUTTON ONCLICK="window.close();">取消</BUTTON>

</BODY>
</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -