简体   繁体   English

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

[英]Google Add-on Card: How to apply color to header text

The Google Apps Script guide below implies that header text can be colored.下面的 Google Apps 脚本指南暗示标题文本可以着色。

When I try using some HTML tags (such as <span color> ), any of them actually worked.当我尝试使用一些 HTML 标签(例如<span color> )时,它们中的任何一个实际上都有效。

Which tag should I use to implement this?我应该使用哪个标签来实现这一点?

突出显示部分标题

UPDATE更新

The following is my code to implement the section header.以下是我实现部分标题的代码。 The <b> tag pair works, but any attempts I made to apply color failed. <b>标签对有效,但我尝试应用颜色的任何尝试都失败了。

CardService.newCardBuilder()
  .addSection(
    CardService.newCardSection()
    .setHeader('<b>header text</b>')
  )
  .build();

The Google Apps Script Card reference doesn't include much about how to handle the Card design but the Google Workspace Add-ons site points to use the G Suite Addon Design Kit . Google Apps Script Card 参考并未包含太多关于如何处理 Card 设计的信息,但 Google Workspace Add-ons 站点指向使用G Suite Addon Design Kit

Regarding the use of HTML the supported tags only a few.关于 HTML 的使用,支持的标签只有几个。 To assing a font color use something like this:要分配字体颜色,请使用以下内容:

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

References参考

Resources资源

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM