form.addColorField¶
since 1.1.0
Add a color field to the current form.
Parameters¶
| Name | Type | Required | Description |
|---|---|---|---|
line |
FormLine | yes | the line where the field should be added |
rect |
Rect | yes | the coordinates |
getValue |
function | yes | the function which will return the current color |
setValue |
function | yes | the function which will be called on color change |
Returns¶
The new field
Examples¶
From the official Ethos documentation
form.addColorField(line, nil, function() return color end, function(newValue) color = newValue end)