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

fixed lingrad

parent 0d507c30
No related branches found
No related tags found
No related merge requests found
...@@ -260,9 +260,9 @@ export class ColorControl extends SimpleParam<PD.Color> { ...@@ -260,9 +260,9 @@ export class ColorControl extends SimpleParam<PD.Color> {
export class ColorScaleControl extends SimpleParam<PD.ColorScale<any>> { export class ColorScaleControl extends SimpleParam<PD.ColorScale<any>> {
onChange = (e: React.ChangeEvent<HTMLSelectElement>) => { this.update(e.target.value); } onChange = (e: React.ChangeEvent<HTMLSelectElement>) => { this.update(e.target.value); }
renderControl() { renderControl() {
return <select value={this.props.value || ''} onChange={this.onChange} disabled={this.props.isDisabled}> return <select value={this.props.value || ''} onChange={this.onChange} disabled={this.props.isDisabled} style={{background: `linear-gradient(to right, ${getColorListFromName(this.props.value).map(c => Color.toStyle(c)).join(', ')})`}}>
{this.props.param.options.map(([value, label]) => {this.props.param.options.map(([value, label]) =>
<option key={value} value={value} style={{background: `linear-gradient(to right, ${getColorListFromName(value).map(c => Color.toStyle(c)).join(', ')})`}}> <option key={value} value={value}>
{label} {label}
</option>)} </option>)}
</select>; </select>;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment