Class RgbColor
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
RgbColor
สีที่กําหนดโดยช่องสีแดง เขียว น้ำเงิน
เมธอด
วิธีการ | ประเภทการแสดงผล | รายละเอียดแบบย่อ |
asHexString() | String | แสดงผลสีเป็นสตริงเลขฐานสิบหก 7 อักขระสไตล์ CSS (#rrggbb) หรือสตริงเลขฐานสิบหก 9 อักขระ (#aarrggbb) |
getBlue() | Integer | ช่องสีน้ำเงินของสีนี้เป็นตัวเลขตั้งแต่ 0 ถึง 255 |
getColorType() | ColorType | รับประเภทของสีนี้ |
getGreen() | Integer | ช่องสีเขียวของสีนี้เป็นตัวเลขตั้งแต่ 0 ถึง 255 |
getRed() | Integer | ช่องสีแดงของสีนี้เป็นตัวเลขตั้งแต่ 0 ถึง 255 |
เอกสารประกอบโดยละเอียด
asHexString()
แสดงผลสีเป็นสตริงเลขฐานสิบหก 7 อักขระสไตล์ CSS (#rrggbb) หรือสตริงเลขฐานสิบหก 9 อักขระ (#aarrggbb)
รีเทิร์น
String
— การนำเสนอสีแบบเลขฐานสิบหก
getBlue()
ช่องสีน้ำเงินของสีนี้เป็นตัวเลขตั้งแต่ 0 ถึง 255
รีเทิร์น
Integer
— ค่าของช่องสีน้ำเงิน
getColorType()
รับประเภทของสีนี้
รีเทิร์น
ColorType
— ประเภทสี
getGreen()
ช่องสีเขียวของสีนี้เป็นตัวเลขตั้งแต่ 0 ถึง 255
รีเทิร์น
Integer
— ค่าของช่องสีเขียว
getRed()
ช่องสีแดงของสีนี้เป็นตัวเลขตั้งแต่ 0 ถึง 255
รีเทิร์น
Integer
— ค่าของช่องสีแดง
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 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."]]