BPMN Color Picker config

Passing configuration when creating bpmn-js instance is an underdocumented feature. When you create it, you can pass any configuration property you want (e.g. foobar will be available as config.foobar). To configure the colors, do:

import BpmnModeler from 'bpmn-js/lib/Modeler';

import BpmnColorPickerModule from 'bpmn-js-color-picker';

const modeler = new BpmnModeler({
  additionalModules: [
    BpmnColorPickerModule
  ],
  colorPicker: [{
    label: 'Fuchsia',
    fill: 'white',
    stroke: 'fuchsia'
  }]
});
2 Likes