Guest User

Untitled

a guest
Dec 11th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. list($r,$g,$b) = array_map('hexdec',str_split($ColourPrimary,2));
  2. $r = $r - 52;
  3. $g = $g - 52;
  4. $b = $b - 52;
  5.  
  6. imagesavealpha($im, true);
  7. imagefilter($im, IMG_FILTER_COLORIZE, $r, $g, $b);
  8.  
  9. $bw = imagesx($im);
  10. $bh = imagesy($im);
  11. $background = imagecreatetruecolor($bw,$bh);
  12. $bkwhite = imagecolorallocate($background, 255, 255, 255);
  13. imagefill($background,0,0,$bkwhite);
  14. imagecopy($background, $im, 0, 0, 0, 0, $bw, $bh);
  15.  
  16. list($r,$g,$b) = array_map('hexdec',str_split($ColourPrimary,2));
  17. $r = $r - 52;
  18. $g = $g - 52;
  19. $b = $b - 52;
  20.  
  21. $imfore = imagecreatefrompng(FILELOCATION);
  22. imagesavealpha($imfore, true);
  23. imagefilter($imfore, IMG_FILTER_COLORIZE, $r, $g, $b);
  24. $bw = imagesx($imfore);
  25. $bh = imagesy($imfore);
  26.  
  27. $im = imagecreatetruecolor($bw,$bh);
  28. $bkwhite = imagecolorallocate($im, 255, 255, 255);
  29. imagefill($im,0,0,$bkwhite);
  30. imagecopy($im, $imfore, 0, 0, 0, 0,$bw,$bh);
Add Comment
Please, Sign In to add comment