sub_title
 ASP
제   목 [ASP] 선택된 칼라테이블의 색상으로 텍스트의 색상을 바꾸기
작성자 다자래 등록일 2008-03-01 14:21:55 조회수 205,113

해외사이트에서 퍼온 소스입니다. 칼라테이블이 나오고 테이블을 클릭하면 그 테이블의
컬러로 텍스트 색상을 변경해줍니다.  웹서버에 넣고 돌려보니 잘 돌아갑니다.

<%
   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 I use the same array for all the colors since
   ' it's really just a mechanism to hold the hex values.
   ' I 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
    Response.Write "<table cellspacing=""0"" cellpadding=""0"" " _
    & "border=""0"">" & vbCrLf

   ' 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 & """>" _
                & "<a href=""color_chooser.asp?color=" & Server.URLEncode(strColor) _
                & """><img src=""images/spacer.gif"" width=""15"" height=""15"" " _
                & "alt=""" & strColor & """ border=""0""></a></td>" & vbCrLf
        Next 'iB
    Next 'iG
    Response.Write "</tr>" & vbCrLf
    Next 'iR
    Response.Write "</table>" & vbCrLf
%>

<p>
<strong>
<font size="+2" color="<%= Request.QueryString("color") %>">
This text will appear in the color you click above.
</font>
</strong>
</p>

 
0
    
 
0
        list
 
※ 짧은 댓글일수록 예의를 갖추어 작성해 주시기 바랍니다.
line
reply cancel
 
번호 제목 글쓴이 추천 조회 날짜
56  [ASP] Html의 테그를 제거해주는 함수   member 다자래 0 / 0 206759 2008-08-20
55  ASP 런타임 에러값   member 오렌지 0 / 0 206136 2008-08-20
54  [ASP] 커서타입 & 락타입   member 오렌지 0 / 0 205550 2008-08-19
53  [ASP] IsEmpy() 함수와 IsNull() 함수의 차이   member 다자래 0 / 0 224134 2008-07-09
52  ASP 함수 모음   member 웹스톤 1 / 0 208799 2008-07-01
51  ASP로 RSS 만들기   member 웹스톤 0 / 0 208670 2008-06-26
50  [ASP] 랜덤링크 배열 이용   member 다자래 0 / 0 207430 2008-06-04
49  [ASP] 선택된 칼라테이블의 색상으로 텍스트의 색상을 바꾸기   member 다자래 0 / 0 204686 2008-06-04
48  ASP 사업자등록번호, 주민등록번호 체크 함수   member 웹스톤 0 / 0 205854 2008-05-07
47  [ASP] 저장된 html 파일을 이용한 메일 발송하기   member 다자래 0 / 0 210533 2008-04-13
46  asp로 xml 읽어 들이는 예제 첨부파일   member 웹스톤 0 / 0 205112 2008-04-05
45  [ASP] ASP에서 쿠키의 사용   member 다자래 0 / 0 207148 2008-03-06
44  [ASP] 캐쉬에 흔적을 남기지 않기   member 다자래 0 / 0 205858 2008-03-06
43  [ASP] 문자열이 몇 바이트인가 알아내는 함수   member 다자래 0 / 0 210386 2008-03-06
42  [ASP] 한글,영문,숫자가 섞인 문자열에서 항상 일정한 길이로 자르기  [1] member 다자래 0 / 1 208979 2008-03-01
41  [ASP] 선택된 칼라테이블의 색상으로 텍스트의 색상을 바꾸기   member 다자래 0 / 0 205113 2008-03-01
40  [ASP] DB를 이용한 랜덤배너 달기   member 다자래 0 / 0 205256 2008-03-01
39  [ASP] ASP에서 Eval 함수 쓰기   member 다자래 0 / 0 215214 2008-03-01
38  [ASP] 문자열 거꾸로 뒤집기   member 다자래 0 / 0 205553 2008-03-01
37  [ASP] 간단한 날짜 구하기(오늘은 몇주째인가?)   member 다자래 0 / 0 206810 2008-03-01
36  ASP에서 페이지의 환경변수(IP,URI,PORT....) 알아내기   member 억새풀 0 / 1 255479 2008-01-04
35  레코드셋 읽어서 변수 자동 생성   member 웹스톤 0 / 0 205692 2007-12-26
34  암호화/ 복호화 - 16진수 이용해서 한글도 가능 -_-   member 웹스톤 0 / 0 209305 2007-12-26
33  asp로 이미지 사이즈(크기) 얻는 함수   member 웹스톤 1 / 0 206296 2007-12-26
32  입력값이 들어왔을때 난수구하기!!   member 오렌지 0 / 0 204701 2007-12-03
write
button [1] [3] [4] button