AI-generated Key Takeaways
-
RgbColor
defines a color using red, green, and blue color channels. -
You can get the individual red, green, and blue color channel values as integers ranging from 0 to 255.
-
The
asHexString()
method provides the color's hexadecimal representation, suitable for CSS use. -
It is possible to determine the color type using the
getColorType()
method.
A color defined by red, green, blue color channels.
Methods
Method | Return type | Brief description |
---|---|---|
as | String | Returns the color as a CSS-style 7 character hexadecimal string (#rrggbb) or 9 character hexadecimal string (#aarrggbb). |
get | Integer | The blue channel of this color, as a number from 0 to 255. |
get | Color | Get the type of this color. |
get | Integer | The green channel of this color, as a number from 0 to 255. |
get | Integer | The red channel of this color, as a number from 0 to 255. |
Detailed documentation
asHexString()
Returns the color as a CSS-style 7 character hexadecimal string (#rrggbb) or 9 character hexadecimal string (#aarrggbb).
Return
String
— The hex representation of color.
getBlue()
The blue channel of this color, as a number from 0 to 255.
Return
Integer
— The value of blue channel.
getColorType()
getGreen()
The green channel of this color, as a number from 0 to 255.
Return
Integer
— The value of green channel.
getRed()
The red channel of this color, as a number from 0 to 255.
Return
Integer
— The value of red channel.