Class RgbColor
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Colore RGB
Un colore definito dai canali di colore rosso, verde e blu.
Metodi
Metodo | Tipo restituito | Breve descrizione |
asHexString() | String | Restituisce il colore come stringa esadecimale di 7 caratteri in stile CSS (#rrggbb) o di 9 caratteri (#aarrggbb). |
getBlue() | Integer | Il canale blu di questo colore, come numero compreso tra 0 e 255. |
getColorType() | ColorType | Recupera il tipo di questo colore. |
getGreen() | Integer | Il canale verde di questo colore, come numero compreso tra 0 e 255. |
getRed() | Integer | Il canale rosso di questo colore, come numero compreso tra 0 e 255. |
Documentazione dettagliata
asHexString()
Restituisce il colore come stringa esadecimale di 7 caratteri in stile CSS (#rrggbb) o di 9 caratteri (#aarrggbb).
Invio
String
: la rappresentazione esadecimale del colore.
getBlue()
Il canale blu di questo colore, come numero compreso tra 0 e 255.
Invio
Integer
: il valore del canale blu.
getColorType()
Recupera il tipo di questo colore.
Invio
ColorType
: il tipo di colore.
getGreen()
Il canale verde di questo colore, come numero compreso tra 0 e 255.
Invio
Integer
: il valore del canale verde.
getRed()
Il canale rosso di questo colore, come numero compreso tra 0 e 255.
Invio
Integer
: il valore del canale rosso.
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-07-26 UTC.
[null,null,["Ultimo aggiornamento 2025-07-26 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."]]