I have been working on a color palette system where a multidimensional array holds different color palettes. EX:
$palette['1']['borderColor'] = "black";
$palette['2']['borderColor'] = "white";
I have a function that should return a color palette item when called but for some reason it's not returning anything. Instead it says "Undefined variable: palette"EX:
$palette['1'] = array(
"borderColor"=> "#222222",
"divColor1"=> "#00f2ff",
"divColor2"=> "#222222",
"headerColor"=> "rgba(38, 38, 38, 0.5)",
"color1"=> "#00f2ff",
"color2"=> "#e9ffdd"
);
function getItem($number, $item) {
return $palette[$number][$item];
}
$borderColor = getItem('1', 'borderColor');
echo "borderColor is> " . $borderColor . " <.";
//returns "borderColor is> <."
Any suggestions?