Class SpreadsheetTheme

試算表主題

存取及修改現有主題。如要在試算表上設定主題,請使用 Spreadsheet.setSpreadsheetTheme(theme)

方法

方法傳回類型簡短說明
getConcreteColor(themeColorType)Color針對有效的主題顏色類型,傳回具體的 Color
getFontFamily()String|null傳回主題的字型系列,如果是 null 主題,則傳回 null
getThemeColors()ThemeColorType[]傳回目前主題的所有可能主題顏色類型清單。
setConcreteColor(themeColorType, color)SpreadsheetTheme將與這個色彩配置中的 ThemeColorType 相關聯的具體顏色,設為指定顏色。
setConcreteColor(themeColorType, red, green, blue)SpreadsheetTheme將這個色彩配置中與 ThemeColorType 相關聯的具體顏色,設為 RGB 格式的指定顏色。
setFontFamily(fontFamily)SpreadsheetTheme設定主題的字型系列。

內容詳盡的說明文件

getConcreteColor(themeColorType)

針對有效的主題顏色類型,傳回具體的 Color。如果目前主題未設定主題顏色類型,就會擲回例外狀況。

參數

名稱類型說明
themeColorTypeThemeColorType主題顏色類型。

回攻員

Color:混凝土顏色。

授權

使用這個方法的指令碼需要一或多個下列範圍的授權:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getFontFamily()

傳回主題的字型系列,如果是 null 主題,則傳回 null

回攻員

String|null:主題字型系列。

授權

使用這個方法的指令碼需要一或多個下列範圍的授權:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getThemeColors()

傳回目前主題的所有可能主題顏色類型清單。

回攻員

ThemeColorType[]:主題顏色清單。

授權

使用這個方法的指令碼需要一或多個下列範圍的授權:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

setConcreteColor(themeColorType, color)

將與這個色彩配置中的 ThemeColorType 相關聯的具體顏色,設為指定顏色。

參數

名稱類型說明
themeColorTypeThemeColorType主題顏色類型。
colorColor顏色。

回攻員

SpreadsheetTheme - 主題,用於鏈結。

授權

使用這個方法的指令碼需要一或多個下列範圍的授權:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

setConcreteColor(themeColorType, red, green, blue)

將這個色彩配置中與 ThemeColorType 相關聯的具體顏色,設為 RGB 格式的指定顏色。

參數

名稱類型說明
themeColorTypeThemeColorType主題顏色類型。
redInteger紅色通道的值。
greenInteger綠色通道的值。
blueInteger藍色管道的值。

回攻員

SpreadsheetTheme - 主題,用於鏈結。

授權

使用這個方法的指令碼需要一或多個下列範圍的授權:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

setFontFamily(fontFamily)

設定主題的字型系列。

參數

名稱類型說明
fontFamilyString新的主題字型系列。

回攻員

SpreadsheetTheme:這個主題用於串連。

授權

使用這個方法的指令碼需要一或多個下列範圍的授權:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets