ColorPicker Edit

Accessible color picker.

Parts of the source code were derived and modified from react-color, released under the MIT license.

Usage

import { ColorPicker } from '@wordpress/components';
import { withState } from '@wordpress/compose';

const MyColorPicker = withState( {
    color: '#f00',
} )( ( { color, setState } ) => {
    return (
        <ColorPicker
            color={ color }
            onChangeComplete={ ( value ) => setState( value.hex ) }
            disableAlpha
        />
    );
} );