Published in: PHP
Sorry to those who previously bookmarked this. In an attempt to delete a previous version that had a logic flaw, I accidently deleted the entire snippet. Anyway, here is a much improved version. Any comments/suggestions are always welcome.
<?php /** * Inverses a provided hex color. If you pass a hex string with a * hash(#), the function will return a string with a hash prepended * @param string $color Hex color to flip * @return string Reversed hex color * @author Koncept * * Last Update: 2008-04-13 */ function inverseHex( $color ) { $prependHash = FALSE; $prependHash = TRUE; } case 3: case 6: break; default: } } return ($prependHash?'#':NULL).$r.$g.$b; } // Demo ?>
You need to login to post a comment.
