GETCOLORRANGE
This function returns the RGBA values of multiple colors as an array, or the value of a single color. The function is used to pass colors from the Application Studio color palette to web extensions.
The color palette contains 64 colors in a grid of 8 rows and 8 columns. Each color in the palette is identified by an index number from 1 to 64. The index numbers increment from top to bottom and from left to right of the grid.
You can specify these color ranges:
- An individual color
- A one-dimensional array
For example, the 34th and the 49th colors in the grid
- A two-dimensional array
For example, a block of four rows with three colors in each row
Syntax
GETCOLORRANGE(initial_index,count_of_colors_per_row,count_of_rows)
Example - single color
When you specify a single color, the count_of_rows
parameter is optional, but defaults to 1.
These examples return the same single color:
=GETCOLORRANGE(2,1)
=GETCOLORRANGE(2,1,1)
=GETCOLOR(2)
.
Example - one-dimensional array
This example returns an array of sixteen color values. The first color is the 34th in the grid and the sixteenth color is 49th color in the grid:
=GETCOLORRANGE(34,l6)
Example - two-dimensional array
This example returns an array of twelve colors. The array contains four rows of three colors each. The first color is the 5th in the grid and the twelfth is the 31st. That is, the function specifies the three colors to the right of the fifth color in the grid, and four rows down from the top:
=GETCOLORRANGE(5,3,4)