Skip to content

Instantly share code, notes, and snippets.

@RyanNutt
Last active November 27, 2015 13:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RyanNutt/204fece9b7b932d0f1a6 to your computer and use it in GitHub Desktop.
Save RyanNutt/204fece9b7b932d0f1a6 to your computer and use it in GitHub Desktop.
PHP script to return the hex codes of the 216 "web safe" colors
<?php
function web_safe_colors() {
$ray = array();
$steps = array(
'00',
'33',
'66',
'99',
'cc',
'ff' );
foreach ( $steps as $r ) {
foreach ( $steps as $g ) {
foreach ( $steps as $b ) {
$ray[] = $r . $g . $b;
}
}
}
return $ray;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment