Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions ColorWheel.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class ColorWheel extends Component {
offset: {x: 0, y: 0},
currentColor: props.initialColor,
pan: new Animated.ValueXY(),
radius: 0,
radius:0
}
}

Expand Down Expand Up @@ -69,7 +69,7 @@ export class ColorWheel extends Component {
}

if (this.props.onColorChangeComplete) {
this.props.onColorChangeComplete(this.state.hsv);
this.props.onColorChangeComplete(this.state.currentColor);
}
},
})
Expand Down Expand Up @@ -154,14 +154,14 @@ export class ColorWheel extends Component {
const hsv = {h: deg, s: 100 * radius, v: 100};
const currentColor = colorsys.hsv2Hex(hsv)
this.setState({hsv, currentColor})
this.props.onColorChange(hsv);
this.props.onColorChange(currentColor);
}

forceUpdate = color => {
const {h, s, v} = colorsys.hex2Hsv(color)
const {h, s, v} = colorsys.hex2Hsv(color)
const {left, top} = this.calcCartesian(h, s / 100)
this.setState({currentColor: color})
this.props.onColorChange({h, s, v})
this.props.onColorChange(color)
this.state.pan.setValue({
x: left - this.props.thumbSize / 2,
y: top - this.props.thumbSize / 2,
Expand All @@ -172,7 +172,7 @@ export class ColorWheel extends Component {
const {h, s, v} = colorsys.hex2Hsv(color)
const {left, top} = this.calcCartesian(h, s / 100)
this.setState({currentColor: color})
this.props.onColorChange({h, s, v})
this.props.onColorChange(color)
Animated.spring(this.state.pan, {
toValue: {
x: left - this.props.thumbSize / 2,
Expand Down