Skip to content

Commit b5c48ad

Browse files
committed
Added logic to color the preview <div> with the actual color selected.
1 parent eee3928 commit b5c48ad

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

webpack_in/entry.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,12 +303,15 @@ class ColorSelector extends React.Component {
303303
}
304304

305305
render() {
306+
const { color } = this.state;
307+
306308
return (
307309
<div style={ objStyleCommon }>
308310
<div style={{ margin: '1em auto',
309311
width: '70%',
310312
height: '3em',
311-
border: 'solid 2px black' }} />
313+
border: 'solid 2px black',
314+
backgroundColor: `rgb(${color.r}, ${color.g}, ${color.b})`}} />
312315
<div style={{ marginTop: '-1em'}}>
313316
<ColorComponentEntry label="R" value={ this.state.color.r } onChangeValue={
314317
(value) => {

0 commit comments

Comments
 (0)