BPMN Color Picker config

How do I inject a custom color palette into the bpmn color picker extension?

I see it checks an injected config.colors, but I can’t figure out how or where to inject that 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

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.