Class RgbColor
Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
Цвет RGB Цвет, определяемый красным, зеленым и синим цветовыми каналами.
Методы
Метод | Тип возврата | Краткое описание |
---|
as Hex String() | String | Возвращает цвет в виде шестнадцатеричной строки из 7 символов в стиле CSS (#rrggbb) или шестнадцатеричной строки из 9 символов (#aarrggbb). |
get Blue() | Integer | Синий канал этого цвета, как число от 0 до 255. |
get Color Type() | Color Type | Получите тип этого цвета. |
get Green() | Integer | Зеленый канал этого цвета, как число от 0 до 255. |
get Red() | Integer | Красный канал этого цвета, как число от 0 до 255. |
Подробная документация
as Hex String()
Возвращает цвет в виде шестнадцатеричной строки из 7 символов в стиле CSS (#rrggbb) или шестнадцатеричной строки из 9 символов (#aarrggbb).
Возвращаться
String
— шестнадцатеричное представление цвета.
get Blue()
Синий канал этого цвета, как число от 0 до 255.
Возвращаться
Integer
— значение синего канала.
get Color Type()
Получите тип этого цвета.
Возвращаться
Color Type
— Цветотип.
get Green()
Зеленый канал этого цвета, как число от 0 до 255.
Возвращаться
Integer
— значение зеленого канала.
get Red()
Красный канал этого цвета, как число от 0 до 255.
Возвращаться
Integer
— значение красного канала.
Если не указано иное, контент на этой странице предоставляется по лицензии Creative Commons "С указанием авторства 4.0", а примеры кода – по лицензии Apache 2.0. Подробнее об этом написано в правилах сайта. Java – это зарегистрированный товарный знак корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2025-07-25 UTC.
[null,null,["Последнее обновление: 2025-07-25 UTC."],[[["\u003cp\u003e\u003ccode\u003eRgbColor\u003c/code\u003e defines a color using red, green, and blue color channels.\u003c/p\u003e\n"],["\u003cp\u003eYou can get the individual red, green, and blue color channel values as integers ranging from 0 to 255.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003easHexString()\u003c/code\u003e method provides the color's hexadecimal representation, suitable for CSS use.\u003c/p\u003e\n"],["\u003cp\u003eIt is possible to determine the color type using the \u003ccode\u003egetColorType()\u003c/code\u003e method.\u003c/p\u003e\n"]]],[],null,["# Class RgbColor\n\nRgbColor\n\nA color defined by red, green, blue color channels. \n\n### Methods\n\n| Method | Return type | Brief description |\n|-----------------------------------|-----------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------|\n| [asHexString()](#asHexString()) | `String` | Returns the color as a CSS-style 7 character hexadecimal string (#rrggbb) or 9 character hexadecimal string (#aarrggbb). |\n| [getBlue()](#getBlue()) | `Integer` | The blue channel of this color, as a number from 0 to 255. |\n| [getColorType()](#getColorType()) | [ColorType](/apps-script/reference/base/color-type) | Get the type of this color. |\n| [getGreen()](#getGreen()) | `Integer` | The green channel of this color, as a number from 0 to 255. |\n| [getRed()](#getRed()) | `Integer` | The red channel of this color, as a number from 0 to 255. |\n\nDetailed documentation\n----------------------\n\n### `as``Hex``String()`\n\nReturns the color as a CSS-style 7 character hexadecimal string (#rrggbb) or 9 character\nhexadecimal string (#aarrggbb).\n\n#### Return\n\n\n`String` --- The hex representation of color.\n\n*** ** * ** ***\n\n### `get``Blue()`\n\nThe blue channel of this color, as a number from 0 to 255.\n\n#### Return\n\n\n`Integer` --- The value of blue channel.\n\n*** ** * ** ***\n\n### `get``Color``Type()`\n\nGet the type of this color.\n\n#### Return\n\n\n[ColorType](/apps-script/reference/base/color-type) --- The color type.\n\n*** ** * ** ***\n\n### `get``Green()`\n\nThe green channel of this color, as a number from 0 to 255.\n\n#### Return\n\n\n`Integer` --- The value of green channel.\n\n*** ** * ** ***\n\n### `get``Red()`\n\nThe red channel of this color, as a number from 0 to 255.\n\n#### Return\n\n\n`Integer` --- The value of red channel."]]