How to add `transparent` on `SketchPicker`?
I am using SketchPicker in my website and want to add a transparent button on the picker. What is the easiest way to do that?
You can add a preset color value as 'TRANSPARENT'
After that, you can add a css rule such as
.your_color_picker_container div[title='TRANSPARENT']{
background-image = url('some transparent checkered image') !important;
}
Is there any doc or sample which demonstrate how to set preset? Below is my code and is preset a property can be passed in?
<SketchPicker
color={this.state.color}
className={`${colorPickerClassName} color-picker`}
onChangeComplete={color => {
this.props.setColor(color);
this.setState({ color });
}}
/>
yeah, pass it as props as: `presetColors - Array of Strings or Objects, Hex strings for default colors at bottom of picker. Default
presetColors={['TRANSPARENT','#D0021B', '#F5A623', '#F8E71C', '#8B572A', '#7ED321', '#417505', '#BD10E0', '#9013FE', '#4A90E2', '#50E3C2', '#B8E986', '#000000', '#4A4A4A', '#9B9B9B', '#FFFFFF']}
presetColors may also be described as an array of objects with color and title properties: [{ color: '#f00', title: 'red' }] or a combination of both`
works great. Thanks.