Color option picker control type

The color option picker control type can be used to allow the user to select a color from a set defined by the developer using a Dataprovider object.

It can be used in scalar or collection variables.

ColorOptionPickerRuntime
Color option picker in runtime

In runtime, the colors are displayed as a grid of squares to the user. The user may click on any square to select it. If the variable is not a collection, selecting one color automatically deselects the one selected previously. If the variable is a collection, the user may select as many items as defined in the "Max Selection Size" property in the ControlInfo node.

This control can be used in variables of char/varchar types.

Using this control

To use this control, add a Control Info node to the attribute/variable and select the "Color Option Picker K2BTools" control type. A default Dataprovider, called "K2BTools.ControlTypes.ColorOptionPicker.Sample", will be selected.

You can use this dataprovider to test the control and see how it works.

To customize the color list we recommend creating a copy of the K2BTools.ControlTypes.ColorOptionPicker.Sample dataprovider.

The dataprovider's return type must be the K2BTools.ControlTypes.ColorOptionPicker.ColorOptions SDT. This SDT's structure is a set containing items defining each color option using these fields:

  • id: The value that will be set when this option is selected.
  • description: This option's description (shown as a tooltip associated to the option).
  • colorCode: The color that should be shown for this option expressed in CSS hex notation. Examples: #FF0000 (red), #00FF00 (green), #0000FF (blue).

The dataprovider can receive parameters. If that's the case, the "Color Picker Data Definition Dataprovider Parameters" properties should be set to load those parameters.

Availability

This control is available from K2BTools 14.2 - Release notes.