<?php
$im = imagecreatetruecolor('example.jpg'); // Le fond de l'image est en rouge $background = imagecolorallocate($im, 255, 0, 0);
// On définit des couleurs avec des entiers .. $white = imagecolorallocate($im, 255, 255, 255); $black = imagecolorallocate($im, 0, 0, 0);
// .. ou des hexadécimaux $white = imagecolorallocate($im, 0xFF, 0xFF, 0xFF); $black = imagecolorallocate($im, 0x00, 0x00, 0x00);
?>
|