Google 附加卡:如何将颜色应用于标题文本

ddf*_*fbb 2 google-apps-script google-workspace-add-ons

下面的 Google Apps 脚本指南暗示标题文本可以着色。

当我尝试使用一些 HTML 标签(例如<span color>)时,它们中的任何一个实际上都有效。

我应该使用哪个标签来实现这个?

突出显示节标题

更新

以下是我实现节标题的代码。标签<b>对有效,但我应用颜色的任何尝试都失败了。

CardService.newCardBuilder()
  .addSection(
    CardService.newCardSection()
    .setHeader('<b>header text</b>')
  )
  .build();
Run Code Online (Sandbox Code Playgroud)

Rub*_*bén 7

Google Apps 脚本卡参考并未详细介绍如何处理卡设计,但 Google Workspace 插件网站指出使用G Suite 插件设计套件

关于 HTML 的使用,支持的标签只有少数。要分配字体颜色,请使用如下内容:

CardService.newCardBuilder()
  .addSection(
    CardService.newCardSection()
    .setHeader('<font color="#ea9999">header text</font>')
  )
  .build();
Run Code Online (Sandbox Code Playgroud)

参考

资源