Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

My php hex color chart, simple coding easy to use

Featured Replies

I had created this for a site im doing so thought i'd share it with anyone whos interested in how to create a color chart in php insted of javascript.

 

<?php
 echo "<table width=\"23%\">";
$ColorArray = array(
'00','CC','33','66','99','FF'
);
$i = 0;
 echo "<tr>";
for($j=0; $j<6; $j++){
for($a=0; $a<6; $a++){
for($b=0; $b<6; $b++){
$v = $ColorArray[$j].$ColorArray[$a].$ColorArray[$b];
echo "<td bgcolor='#".$v."'></td>";
$i++;
if(!($i%25==0)) {
 echo "<td></td>";
}
if($i%25==0) {
echo "</tr><tr>";
}
}
}
}
echo "</tr>";
echo "</table>";

  • Author

And using the same concept i made this one in javascript as well incase anyone prefers JS over PHP, or if thats the primary language u code in.

 

<script language="javascript">

c = '<table width="23%">';
ColorArray = new Array('00','CC','33','66','FF' );

for(j=0;j<5;j++){
for(a=0;a<5;a++){
 c +='<tr>';
 for(b=0;b<5;b++){

 v = ColorArray[j]+ColorArray[a]+ColorArray[b];
 c+= '<td bgcolor=#'+v+' style="padding:10px; cursor:pointer;"></td>';
 }
 c+= '</tr>';
}

}
document.write(c+'</table>');



</script>

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.