registerPalette()
Overview
public void function registerPalette(
required string name
, required array colours
, numeric rowLength = 16
)
Registers a colour palette for use with the simpleColourPicker form control.
Arguments
Name | Type | Required | Description |
---|---|---|---|
name | string | Yes | Name by which you will refer to your palette in the form definition XML |
colours | array | Yes | An array of colour values, in either RGB format (just the numbers, e.g. 100,150,0 ) or a 3- or 6-character hex value - or even a mixture of the two. |
rowLength | numeric | No (default=16) | The maximum number of colours displayed on each row of the colour picker |
Example
simpleColourPickerService.registerPalette(
name = "greyscale"
, colours = [ "000", "111", "222", "333", "444", "555", "666", "777", "888", "999", "aaa", "bbb", "ccc", "ddd", "eee", "fff" ]
, rowLength = 8
);