Skip to content
Snippets Groups Projects
Commit a069a745 authored by luna215's avatar luna215
Browse files

Added a background linear gradient to color control parameters

parent bc81523e
No related branches found
No related tags found
No related merge requests found
...@@ -248,7 +248,10 @@ export class ColorControl extends SimpleParam<PD.Color> { ...@@ -248,7 +248,10 @@ export class ColorControl extends SimpleParam<PD.Color> {
} }
renderControl() { renderControl() {
return <select value={this.props.value} onChange={this.onChange} style={{ borderLeft: `16px solid ${Color.toStyle(this.props.value)}` }}> let rgb: any[] = Color.toStyle(this.props.value).replace('rgb(', '').split(', ');
rgb = rgb.map(c => parseInt(c));
let secondArg = `rgb(${rgb[0]}, ${rgb[1]}, ${rgb[2]}, 0.0)`;
return <select value={this.props.value} onChange={this.onChange} style={{background: `linear-gradient(90deg, ${Color.toStyle(this.props.value)}, ${secondArg})`}}>
{ColorValueOption(this.props.value)} {ColorValueOption(this.props.value)}
{ColorOptions()} {ColorOptions()}
</select>; </select>;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment