optLayout);
layoutLeft.addComponent(optPanel);
HorizontalLayout layout1 = createHorizontalLayout();
colorpicker1 = new ColorPicker("Foreground", foregroundColor);
colorpicker1.setHtmlContentAllowed(true);
colorpicker1.addColorChangeListener(this);
colorpicker1.setId("colorpicker1");
layout1.addComponent(colorpicker1);
layout1.setComponentAlignment(colorpicker1, Alignment.MIDDLE_CENTER);
colorpicker2 = new ColorPicker("Background", backgroundColor);
colorpicker2.addColorChangeListener(this);
colorpicker2.setId("colorpicker2");
layout1.addComponent(colorpicker2);
layout1.setComponentAlignment(colorpicker2, Alignment.MIDDLE_CENTER);
Panel panel1 = new Panel(
"Button-like colorpicker with current color and CSS code",
layout1);
layoutLeft.addComponent(panel1);
HorizontalLayout layout2 = createHorizontalLayout();
colorpicker3 = new ColorPicker("Foreground", foregroundColor);
colorpicker3.addColorChangeListener(this);
colorpicker3.setWidth("120px");
colorpicker3.setCaption("Foreground");
colorpicker3.setId("colorpicker3");
layout2.addComponent(colorpicker3);
layout2.setComponentAlignment(colorpicker3, Alignment.MIDDLE_CENTER);
colorpicker4 = new ColorPicker("Background", backgroundColor);
colorpicker4.addColorChangeListener(this);
colorpicker4.setWidth("120px");
colorpicker4.setCaption("Background");
colorpicker4.setId("colorpicker4");
layout2.addComponent(colorpicker4);