From eab5a3bf3df1088c9127f58249fe65dcf2a3f5be Mon Sep 17 00:00:00 2001 From: Juan David Nicholls Cardona Date: Fri, 25 Jan 2019 00:29:01 -0500 Subject: [PATCH] Add style prop to override the default styles (#21) --- index.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/index.js b/index.js index d5fc597..79c2116 100644 --- a/index.js +++ b/index.js @@ -94,7 +94,7 @@ class AnimatedGradient extends Component { render () { const {color0, color1} = this.state; - const {customColors, children, points} = this.props; + const {customColors, children, points, style} = this.props; const preferColors = []; // while (preferColors.length < customColors.length) { while (preferColors.length < 2) { @@ -104,17 +104,16 @@ class AnimatedGradient extends Component { .concat(customColors.slice(0, preferColors.length+1)) ) } - const interpolatedColors = [color0, color1] - .map((animatedColor, index) => { - return animatedColor.interpolate({ - inputRange: Array.from({length: customColors.length+1}, (v, k) => k), - outputRange: preferColors[index] - }) - }); + const interpolatedColors = [color0, color1].map((animatedColor, index) => { + return animatedColor.interpolate({ + inputRange: Array.from({length: customColors.length+1}, (v, k) => k), + outputRange: preferColors[index] + }) + }); return (