Skip to content

Instantly share code, notes, and snippets.

@olekukonko
Created October 17, 2013 15:47
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 olekukonko/7027323 to your computer and use it in GitHub Desktop.
Save olekukonko/7027323 to your computer and use it in GitHub Desktop.
// Inverse imagecolorat
$rgb = 11840909 ;
$r = ($rgb >> 16) & 0xFF;
$g = ($rgb >> 8) & 0xFF;
$b = $rgb & 0xFF;
// Convert To R , G, B
var_dump($r ,$g , $b);
// Back to RGB
$rgb = $b + $g * 0x100 + $r * 0x10000;
var_dump($rgb);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment