What is the correct way to define and pass color parameters in PHP image functions?

When working with color parameters in PHP image functions, it is important to define colors using the appropriate format. Colors can be defined using hexadecimal values or RGB values. When passing color parameters to PHP image functions, make sure to use the correct format based on the function's requirements.

// Define colors using hexadecimal values
$red = imagecolorallocate($image, 255, 0, 0); // red color
$green = imagecolorallocate($image, 0, 255, 0); // green color
$blue = imagecolorallocate($image, 0, 0, 255); // blue color

// Define colors using RGB values
$red = imagecolorallocate($image, 255, 0, 0); // red color
$green = imagecolorallocate($image, 0, 255, 0); // green color
$blue = imagecolorallocate($image, 0, 0, 255); // blue color