Color.fromList
Jump to navigation
Jump to search
color.fromList converts a color in RGB list form — red, green, blue, and optional alpha, all in the range 0-255 — to a string in standard color form.
See also: color.toList
Arguments
| Parameter Name | Type | Default Value | Meaning |
|---|---|---|---|
| rgbaList | list | null | list of the form [red, green, blue] or [red, green, blue, alpha]
|
Usage Notes
All methods and colors in the Mini Micro API, except this one, represent colors as hexadecimal strings, e.g. "#FF8080C8". However, sometimes it is convenient to represent a color as a list of numbers, so for example you can do math with them. Then, use color.fromList to convert this list back into standard color form.
Example
print color.fromList([255, 128, 0, 200])
The above prints #FF8000C8.