Class ColorBuilder

Color Builder

The builder for Color Builder . To create a new builder, use Spreadsheet App.newColor() .

Methods

Method Return type Brief description
Rgb Color Converts this color to an Rgb Color .
Theme Color Converts this color to a Theme Color .
Color Creates a color object from the settings supplied to the builder.
Color Type Get the type of this color.
Color Builder Sets as RGB color.
Color Builder Sets as theme color.

Detailed documentation

as Rgb Color()

Converts this color to an Rgb Color .

Return

Rgb Color — The RGB color.

Throws

Error — if the color is not an Rgb Color

Authorization

Scripts that use this method require authorization with one or more of the following scopes :

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

as Theme Color()

Converts this color to a Theme Color .

Return

Theme Color — The theme color.

Throws

Error — if the color is not a Theme Color .

Authorization

Scripts that use this method require authorization with one or more of the following scopes :

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

build()

Creates a color object from the settings supplied to the builder.

Return

Color — A color object created from this builder.


get Color Type()

Get the type of this color.

Return

Color Type — The color type.

Authorization

Scripts that use this method require authorization with one or more of the following scopes :

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

set Rgb Color(cssString)

Sets as RGB color.

Parameters

Name Type Description
css String
String The RGB color in CSS notation (such as '#ffffff').

Return

Color Builder — This builder, for chaining.


set Theme Color(themeColorType)

Sets as theme color.

Parameters

Name Type Description
theme Color Type
Theme Color Type The theme color type.

Return

Color Builder — This builder, for chaining.

Create a Mobile Website
View Site in Mobile | Classic
Share by: