All pastes #28467 Raw Edit

Untitled

public php v1 · immutable
#28467 ·published 2005-11-12 17:21 UTC
rendered paste body
<?phpheader("Content-type: image/png");$source = imagecreate(1, 255);$start_color = ltrim(trim("#FFFFFF"), "#");$end_color = ltrim(trim("#00FFFF"), "#");		$start_color = array("red" => base_convert(substr($start_color, 0, 2), 16, 10), "green" => base_convert(substr($start_color, 2, 2), 16, 10), "blue" => base_convert(substr($start_color, 4, 2), 16, 10));$end_color = array("red" => base_convert(substr($end_color, 0, 2), 16, 10), "green" => base_convert(substr($end_color, 2, 2), 16, 10), "blue" => base_convert(substr($end_color, 4, 2), 16, 10));for ($y = 0; $y < imagesy($source); $y++){	if ($start_color['red'] < $end_color['red'])		$start_color['red']++;			if ($start_color['green'] < $end_color['green'])		$start_color['green']++;			if ($start_color['blue'] < $end_color['blue'])		$start_color['blue']++;		$color = imagecolorallocate($source, $start_color['red'], $start_color['green'], 						$start_color['blue']);	imagesetpixel($source, 0, $y, $color);}imagepng($source);?>