First of all, I think you should take a look at this great Particletree blog post .
smarty_modifier_contrast() , :
function color_contrast($bgcolor, $color1, $color2, $color3, ...)
{
return (hexdec($bgcolor) > 0xffffff / 2) ? min(array_slice(func_get_args(), 1)) : max(array_slice(func_get_args(), 1));
}
, ( #!), , , , - $bgcolor :
function color_contrast($bgcolor, $colors = array())
{
return (hexdec($bgcolor) > 0xffffff / 2) ? min($colors) : max($colors);
}
$bgcolor, , , , , , , .