Search in sources :

Example 1 with ColorChooser

use of processing.app.ui.ColorChooser in project processing by processing.

the class ColorSelector method run.

public void run() {
    if (selector == null) {
        synchronized (ColorSelector.class) {
            if (selector == null) {
                selector = new ColorChooser(base.getActiveEditor(), false, Color.WHITE, Language.text("menu.edit.copy"), new ActionListener() {

                    @Override
                    public void actionPerformed(ActionEvent e) {
                        Clipboard c = Toolkit.getSystemClipboard();
                        c.setContents(new StringSelection(selector.getHexColor()), null);
                    }
                });
            }
        }
    }
    selector.show();
}
Also used : ColorChooser(processing.app.ui.ColorChooser) Clipboard(java.awt.datatransfer.Clipboard) StringSelection(java.awt.datatransfer.StringSelection)

Aggregations

Clipboard (java.awt.datatransfer.Clipboard)1 StringSelection (java.awt.datatransfer.StringSelection)1 ColorChooser (processing.app.ui.ColorChooser)1