Snippet Name: Invert Hex Color #2
Description: Invert a hexadecimal color value. Doesn't get any easier than this.
Comment: (none)
Language: PHP
Highlight Mode: PHP
Last Modified: February 27th, 2009
|
<?PHP
// precond: $color is a hex integer
// postcond: returns inversion
FUNCTION InvertColor($color){
RETURN (int) 0xffffff - $color;
}
?> |