Quick Search:
 
 PHP Code: Invert Hex Color #2 Jump to:  
Category: >> PHP Code >> Invert Hex Color #2  

<< lastnext >>

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;
}
 
?>


 
   Home |    Search |    Code Library |    Sponsors |    Privacy |    Terms of Use |    Contact Us © 2003 - 2024 psoug.org