CodeAve.com CodeAve.com - ASP - Miscellaneous
ASP
·Read/Write
·Script Writers
·Database Display
·Response Objects
·Server Variables
·Random Events
·Articles
·Miscellaneous
·Contents
·What's New?
JavaScript
CSS
HTML
Maps
Links
Mail List
Search
Sitemap


 


Color Safe Palette or Nested For Next Loops & Arrays
The browser can do a great many things, but it has a limit of 216 colors that can “safely” (without dithering or color washout) display. Fortunately, there are many ways that you can display all the color combinations in the browser safe color palette (I do not think I have seen two places do this the same way yet). By placing the six possible values for color (00,33,66,99,CC,FF) in an array and nesting three for next statements with values one through six a table with all the color codes will neatly be displayed in a table.
View the Output
Text View
Print View
Mail this Link
Download the Code

<html>
<title>CodeAve.com(Color Safe Palette or Nested For Next Statments with Arrays)</title>
<body bgcolor="#FFFFFF">

<table border=1 width=500 align=center>
<caption>Web Browser Color Safe Palette</caption>
<%
' Set up the varible color with all the values to loop through
dim color(6)
color(1)="00"
color(2)="33"
color(3)="66"
color(4)="99"
color(5)="CC"
color(6)="FF"

' Nest the counters
for r_counter = 1 to 6 %>
<tr><%
for g_counter = 1 to 6
for b_counter = 1 to 6
%>

<td align="center" bgcolor="<% 
' Write out the value for each array for the current count to change the bgcolor 
response.write color(r_counter) & color(g_counter) & color(b_counter) %>
">
<font color='#FFFFFF'><b>
<
' Write out the value for each array for the current count to display the color code 
response.write color(r_counter) & color(g_counter) & color(b_counter) %>

</b></font>
</td>
<% 
next ' loop to change b_counter 
%>

</tr>

<% 
next ' loop to change g_counter
next ' loop to change r_counter
%>


</body>
</html>

 

 

 



ASP: What's New? | Articles | Script Writers | Database Display | Read/Write
Server Variables | Response Objects | Random Events | Miscellaneous
HTML: Forms | Hyperlinks | Headers | Tables | Hyperlinks | Headers | Text Display
JavaScript: Document Info | Forms | Images | Navigation | Script Writers
CSS: Basics | Page Display | Text Display | Script Writers | Miscellaneous
  • 2014 michael kors
  • air max women 2013
  • 2014 michael kors
  • air max 2014
  • oakley glasses
  • oakley glasses

  • Maps: Map Script Writers | Bing Maps | Google Maps
  • bottes fr
  • ugg boot
  • Privacy Statement

    CodeAve.com is hosted by MyHosting.com
    Donate Food Online with a Mouse Click at TheHungerSite.com
    Donate Land Online with a Mouse Click at TheRainForestSite.com
    © 1999 - 2017 CodeAve.com
    All Rights Reserved

  • Kids jordan 6 rings
  • Jordan retro 10
  • Jordan retro 3