blockly > FieldColour > (constructor)
FieldColour.(constructor)
Constructs a new instance of the FieldColour
class
Signature:
constructor(value?: string | typeof Field.SKIP_SETUP, validator?: FieldColourValidator, config?: FieldColourConfig);
Parameters
Parameter | Type | Description |
---|---|---|
value | string | typeof Field.SKIP_SETUP | (Optional) The initial value of the field. Should be in '#rrggbb' format. Defaults to the first value in the default colour array. Also accepts Field.SKIP_SETUP if you wish to skip setup (only used by subclasses that want to handle configuration and setting the field value after their own constructors have run). |
validator | FieldColourValidator | (Optional) A function that is called to validate changes to the field's value. Takes in a colour string & returns a validated colour string ('#rrggbb' format), or null to abort the change. |
config | FieldColourConfig | (Optional) A map of options used to configure the field. See the [field creation documentation]https://developers.google.com/blockly/guides/create-custom-blocks/fields/built-in-fields/colour for a list of properties this parameter supports. |