Location: PHPKode > projects > paperasse > paperasse/couleur.php
<?php
# ---------------------------------------
# Paperasse (c) 2006 Guillaume BETTAYEB
# mail and documents management web page
# hide@address.com
# ---------------------------------------
$valeurs = array(1=>'00','33','66','99','CC','FF');

function bleu($array_valeurs){
	$x=1;
	while($x<=count($array_valeurs)){
		$bleu[$x]='#RRVV'.$array_valeurs[$x];
		$x++;
	}
	return $bleu;
}

function vert($valeur,$bleu){
	foreach($bleu as $v){
		$vert[] = str_replace('VV',$valeur,$v);
	}
	return $vert;
}

function rouge($valeurs,$vert){
	foreach($valeurs as $v){
		$rouge[] = str_replace('RR',$v,$vert);
	}
	return $rouge;
}

function fusion_tableaux_rvb(){
	global $valeurs;
		$x=1;
		while($x<=count($valeurs)){
		$res[$x]= rouge($valeurs,vert($valeurs[$x],bleu($valeurs)));
		$x++;
	}
	return $res;
}

function fusion_dimensions($fusion_tableaux_rvb,$dimension1){
	$fusion_dimensions = array ();
	for($dimension2=0;$dimension2<6;$dimension2++){
		array_push($fusion_dimensions,current($fusion_tableaux_rvb[$dimension1][$dimension2]));
		array_push($fusion_dimensions,next($fusion_tableaux_rvb[$dimension1][$dimension2]));
		array_push($fusion_dimensions,next($fusion_tableaux_rvb[$dimension1][$dimension2]));
		array_push($fusion_dimensions,next($fusion_tableaux_rvb[$dimension1][$dimension2]));
		array_push($fusion_dimensions,next($fusion_tableaux_rvb[$dimension1][$dimension2]));
		array_push($fusion_dimensions,next($fusion_tableaux_rvb[$dimension1][$dimension2]));
	}
	return $fusion_dimensions;
}
for($dimension1=1;$dimension1<=6;$dimension1++){
	$res[$dimension1]=fusion_dimensions(fusion_tableaux_rvb(),$dimension1);
}
$rvb = array_merge($res[1],$res[2],$res[3],$res[4],$res[5],$res[6]);
?>
Return current item: paperasse