Código PHP:
function estilo($pintar)
{
if ($pintar == 'black')
{
$color='#000000';
}
if ($pintar == 'white')
{
$color='#FFFFFF';
}
if ($pintar == 'red')
{
$color='#AA0000';
}
else $color='#000000';
return $color;
}
body
{
background-color: <?= function estilo($_GET["layout"])?>
}
Prueba eso...
Saludos