Create Web Safe Color palette using JavaScript
Generating web safe color palette can be easily done using JavaScript. Web safe palette contains 256 colors that we can come up with by mixing some basic colors.
Here is the code.
|
<script language="javascript"> //first lets start with the table that will contain the palette //next we define the array of basic colors including black, white and gray //now we will iterate through colors. Notice how number 6 corresponds to number of items in the array c // each row will have 6 colors //this creates hex code for each color //now lets create table cell for each color //now let's display the palette |
See the result below
Emir Plicanic owns and operates a web design company (