Skip to content

Instantly share code, notes, and snippets.

@susanBuck
Created March 14, 2012 22:41
Show Gist options
  • Save susanBuck/2040132 to your computer and use it in GitHub Desktop.
Save susanBuck/2040132 to your computer and use it in GitHub Desktop.
less-color-palette
function print_colors($filename) {
$handle = fopen($filename, "rb");
$colors = fread($handle, filesize($filename));
$colors = explode(";", $colors);
foreach($colors as $color_info) {
$color = explode("#", $color_info);
$color = $color[1];
echo "<div style='font-size:12px; width:200px; font-family:arial; padding:5px; margin:6px; background-color:".$color."'>".$color_info."</div>";
}
fclose($handle);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment