Kronolith::getCSSColors PHP Method

getCSSColors() public static method

Returns the CSS color definition for a calendar.
public static getCSSColors ( array | Horde_Share_Object $calendar, boolean $with_attribute = true ) : string
$calendar array | Horde_Share_Object A calendar share or a hash from a remote calender definition.
$with_attribute boolean Whether to wrap the colors inside a "style" attribute.
return string A CSS string with color definitions.
    public static function getCSSColors($calendar, $with_attribute = true)
    {
        $css = 'background-color:' . self::backgroundColor($calendar) . ';color:' . self::foregroundColor($calendar);
        if ($with_attribute) {
            $css = ' style="' . $css . '"';
        }
        return $css;
    }