Skip to content

Commit ce5f5ab

Browse files
committed
Added logic to color the border of the preview <div> in the opposite color of that being previewed, for better contrast.
1 parent b5c48ad commit ce5f5ab

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

webpack_in/entry.jsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,12 +305,20 @@ class ColorSelector extends React.Component {
305305
render() {
306306
const { color } = this.state;
307307

308+
const colorOpposite = {
309+
r: 255 - color.r,
310+
g: 255 - color.g,
311+
b: 255 - color.b
312+
};
313+
308314
return (
309315
<div style={ objStyleCommon }>
310316
<div style={{ margin: '1em auto',
311317
width: '70%',
312318
height: '3em',
313-
border: 'solid 2px black',
319+
border: `solid 2px rgb(${colorOpposite.r},
320+
${colorOpposite.g},
321+
${colorOpposite.b})`,
314322
backgroundColor: `rgb(${color.r}, ${color.g}, ${color.b})`}} />
315323
<div style={{ marginTop: '-1em'}}>
316324
<ColorComponentEntry label="R" value={ this.state.color.r } onChangeValue={

0 commit comments

Comments
 (0)