获取谷歌日历事件颜色(通过PHP)

获取谷歌日历事件颜色(通过PHP),php,api,google-api,google-calendar-api,google-api-php-client,Php,Api,Google Api,Google Calendar Api,Google Api Php Client,我正在尝试从我的谷歌日历中获取活动的颜色。标题、描述和日期已经生效。但我不明白它的颜色 我使用莎拉·贝利的密码 $newmonth = $eventdate->format("M"); $newday = $eventdate->format("j"); $newtime = $eventdate->format("H:i"); $description = $event->description; ?> <div c

我正在尝试从我的谷歌日历中获取活动的颜色。标题、描述和日期已经生效。但我不明白它的颜色

我使用莎拉·贝利的密码

$newmonth = $eventdate->format("M");
     $newday = $eventdate->format("j");
     $newtime = $eventdate->format("H:i");
     $description = $event->description;

    ?>

<div class="entry">
    <div class="color" style="background-color: #_HERE COLOR OF EVENT_;">
        ---
    </div>
$newmonth=$eventdate->format(“M”);
$newday=$eventdate->format(“j”);
$newtime=$eventdate->format(“H:i”);
$description=$event->description;
?>
---
你能帮我从活动中获取ColorId吗

致以最良好的祝愿

你试过了吗


是的,但它只是给了我一个白页(错误)。我在上面的脚本中加入了颜色。
$colors = $service->colors->get();

// Print available calendarListEntry colors.
foreach ($colors->getCalendar() as $key => $color) {
  print "colorId : {$key}\n";
  print "  Background: {$color->getBackground()}\n";
  print "  Foreground: {$color->getForeground()}\n";
}
// Print available event colors.
foreach ($colors->getEvent() as $key => $color) {
  print "colorId : {$key}\n";
  print "  Background: {$color->getBackground()}\n";
  print "  Foreground: {$color->getForeground()}\n";
}