private static DefaultComboBoxModel createModel(Color[] colors, String[] names, boolean allowCustomColors) {
        DefaultComboBoxModel model = new DefaultComboBoxModel();
        for (int i = 0; i < colors.length; i++) {
            Color c = colors[i];
            String text = null;
            if (i < names.length) {
                text = names[i];
            }
            if (null == text) {
                text = ColorValue.toText(c);
            }
            model.addElement(new ColorValue(text, c, false));
        }
        if (allowCustomColors) {
            model.addElement(ColorValue.CUSTOM_COLOR);
        }
        return model;
    }