如何设置通过API创建的Google日历的颜色

时间:2016-10-06 18:24:32

标签: php calendar google-calendar-api google-api-php-client

我正在使用带有PHP的Google日历API。我知道如何创建新日历,但如何设置我创建的日历的颜色?我一直在寻找几个小时。我试过了

$calendar -> setColor();

我试过

$calendar -> setColorId();

两者都是未定义的方法。我找到了关于如何modify the color definitions的文档。并用

发送事件的颜色
$event -> setColorId();

但我无法找到任何关于如何设置日历颜色的内容。

1 个答案:

答案 0 :(得分:1)

我认为您可以使用CalendarList: update更改日历的颜色。

here声明CalendarList是用户添加到其列表中的所有日历条目的集合(显示在Web UI的左侧面板中)。您可以使用它在用户列表中添加和删除现有日历。您还可以使用它来检索和设置特定于用户的日历属性的值,例如默认提醒。另一个例子是前景色,因为不同的用户可以为同一个日历设置不同的颜色。

此外,Calendar API现在包含用于日历的自定义colors字段。 CalendarList资源现在包含取代backgroundColor的{​​{1}}和foregroundColor个属性。要使用新的自定义颜色,请在执行更新时将colorId设置为colorRgbFormat

来源:What's New in v3 - Custom colors for Calendars

相关问题