Skip to content

Commit

Permalink
Added logic to color the border of the preview <div> in the opposite …
Browse files Browse the repository at this point in the history
…color of that being previewed, for better contrast.
  • Loading branch information
maratbn committed Aug 5, 2018
1 parent b5c48ad commit ce5f5ab
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion webpack_in/entry.jsx
Expand Up @@ -305,12 +305,20 @@ class ColorSelector extends React.Component {
render() {
const { color } = this.state;

const colorOpposite = {
r: 255 - color.r,
g: 255 - color.g,
b: 255 - color.b
};

return (
<div style={ objStyleCommon }>
<div style={{ margin: '1em auto',
width: '70%',
height: '3em',
border: 'solid 2px black',
border: `solid 2px rgb(${colorOpposite.r},
${colorOpposite.g},
${colorOpposite.b})`,
backgroundColor: `rgb(${color.r}, ${color.g}, ${color.b})`}} />
<div style={{ marginTop: '-1em'}}>
<ColorComponentEntry label="R" value={ this.state.color.r } onChangeValue={
Expand Down

0 comments on commit ce5f5ab

Please sign in to comment.