[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-12-02 UTC."],[[["\u003cp\u003e\u003ccode\u003eColorBuilder\u003c/code\u003e facilitates the creation and customization of color objects within Google Sheets using Apps Script.\u003c/p\u003e\n"],["\u003cp\u003eMethods such as \u003ccode\u003esetRgbColor()\u003c/code\u003e and \u003ccode\u003esetThemeColor()\u003c/code\u003e are used to define the color, while \u003ccode\u003ebuild()\u003c/code\u003e generates the final \u003ccode\u003eColor\u003c/code\u003e object.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003easRgbColor()\u003c/code\u003e and \u003ccode\u003easThemeColor()\u003c/code\u003e methods enable the conversion of the color to specific color types.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003egetColorType()\u003c/code\u003e reveals the color's current type (RGB or Theme).\u003c/p\u003e\n"],["\u003cp\u003eSeveral of these methods necessitate authorization with relevant scopes for access to spreadsheet data.\u003c/p\u003e\n"]]],["ColorBuilder facilitates creating color objects using `SpreadsheetApp.newColor()`. It allows conversion to `RgbColor` or `ThemeColor`. Key actions include `build()` to create a color object, `getColorType()` to retrieve the color type, `setRgbColor(cssString)` to define an RGB color, and `setThemeColor(themeColorType)` to define a theme color. Methods may require specific authorization scopes like `spreadsheets.currentonly` or `spreadsheets`. The builder can be chained.\n"],null,["ColorBuilder\n\nThe builder for [ColorBuilder](#). To create a new builder, use [SpreadsheetApp.newColor()](/apps-script/reference/spreadsheet/spreadsheet-app#newColor()). \n\nMethods\n\n| Method | Return type | Brief description |\n|-----------------------------------------------------------------|--------------------------------------------------------------|----------------------------------------------------------------------------------------|\n| [asRgbColor()](#asRgbColor()) | [RgbColor](../base/rgb-color.html) | Converts this color to an [RgbColor](../base/rgb-color.html). |\n| [asThemeColor()](#asThemeColor()) | [ThemeColor](/apps-script/reference/spreadsheet/theme-color) | Converts this color to a [ThemeColor](/apps-script/reference/spreadsheet/theme-color). |\n| [build()](#build()) | [Color](/apps-script/reference/spreadsheet/color) | Creates a color object from the settings supplied to the builder. |\n| [getColorType()](#getColorType()) | [ColorType](../base/color-type.html) | Get the type of this color. |\n| [setRgbColor(cssString)](#setRgbColor(String)) | [ColorBuilder](#) | Sets as RGB color. |\n| [setThemeColor(themeColorType)](#setThemeColor(ThemeColorType)) | [ColorBuilder](#) | Sets as theme color. |\n\nDetailed documentation \n\n`as``Rgb``Color()` \nConverts this color to an [RgbColor](../base/rgb-color.html).\n\nReturn\n\n\n[RgbColor](../base/rgb-color.html) --- The RGB color.\n\nThrows\n\n\n[`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) --- if the color is not an [RgbColor](../base/rgb-color.html)\n\nAuthorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/spreadsheets.currentonly`\n- `https://www.googleapis.com/auth/spreadsheets`\n\n*** ** * ** ***\n\n`as``Theme``Color()` \nConverts this color to a [ThemeColor](/apps-script/reference/spreadsheet/theme-color).\n\nReturn\n\n\n[ThemeColor](/apps-script/reference/spreadsheet/theme-color) --- The theme color.\n\nThrows\n\n\n[`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) --- if the color is not a [ThemeColor](/apps-script/reference/spreadsheet/theme-color).\n\nAuthorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/spreadsheets.currentonly`\n- `https://www.googleapis.com/auth/spreadsheets`\n\n*** ** * ** ***\n\n`build()` \nCreates a color object from the settings supplied to the builder.\n\nReturn\n\n\n[Color](/apps-script/reference/spreadsheet/color) --- A color object created from this builder.\n\n*** ** * ** ***\n\n`get``Color``Type()` \nGet the type of this color.\n\nReturn\n\n\n[ColorType](../base/color-type.html) --- The color type.\n\nAuthorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/spreadsheets.currentonly`\n- `https://www.googleapis.com/auth/spreadsheets`\n\n*** ** * ** ***\n\n`set``Rgb``Color(cssString)` \nSets as RGB color.\n\nParameters\n\n| Name | Type | Description |\n|---------------|----------|----------------------------------------------------|\n| `css``String` | `String` | The RGB color in CSS notation (such as '#ffffff'). |\n\nReturn\n\n\n[ColorBuilder](#) --- This builder, for chaining.\n\n*** ** * ** ***\n\n`set``Theme``Color(themeColorType)` \nSets as theme color.\n\nParameters\n\n| Name | Type | Description |\n|----------------------|-----------------------------------------------------------------------|-----------------------|\n| `theme``Color``Type` | [ThemeColorType](/apps-script/reference/spreadsheet/theme-color-type) | The theme color type. |\n\nReturn\n\n\n[ColorBuilder](#) --- This builder, for chaining."]]